How to create a custom character in Turbo C ++

I came to a point in C ++ where I need a custom character. I will try to explain what I want to say: since you guys already know that characters in text mode are dot patterns such as "A", like:

0000001000000 0000010100000 0000100010000 0001000001000 0001000001000 0001111111000 0001000001000 0001000001000 0001000001000 

... where 1 represents the active point and 0 is inactive. I want to know how to create such a character in this way. I was told that there is a way (without a huge mess), but I was not carefully oriented. I hope I get help here. thanks.

+4
source share
3 answers

Assuming you're targeting DOS in text mode - read on interrupt 10h, AH 11h. It allows you to load custom characters into the memory of a character generator. See here: http://webpages.charter.net/danrollins/techhelp/0151.HTM

I don't think Turbo C has a wrapper function for this private call. To call interrupts directly, use the int86 () function.

+3
source

This deals with the memory of the text mode of the video adapter, calls within 10 hours of the BIOS, etc. So, the 1990s ... Most modern operating systems do not work in text mode and use TrueType fonts (even for "console" applications that emulate text mode).

+2
source

If you need a double horizontal line character that takes the whole block, so that the line runs smoothly, the 0xCD ( ) pseudographic character can help.

It depends on the current code page, but most national code pages (including Cyrillic 866) leave the pseudographic characters intact.

Just print the line from 0xCD, see how it looks.

 for(i=0;i<20;i++) putchar(0xcd); 
+2
source

All Articles