The standard font is monocromatic, and is stored in memory in the 8x16 format. This means that each
character use 8 bit for scan line, and have 16 scan lines. Each bit of the scan line is 1 if the
pixel of the character is on, or 0 if the pixel of the character is off. So we must controll all
the bits of all the scan lines to draw a character:
void font_putchar(int x, int y, char ch)
{
int countx, county, cmp;
for(county=0;county<16;county++)
for(countx=0,cmp=0x80;countx<8;countx++,cmp>>=1)
if(fonttable[ch][county]&cmp)
put_pixel(x+countx, y+county, font_color);
}
For the strings all call the function font_putchar()
for each character:
void font_putstring(int x, int y, char *str)
{
int i;
for(i=0;str[i];i++)
{
font_putchar(x, y, str[i]);
x+=8;
}
}
I wrote a demo program, but it will not work without W95. Is better to
see the demo program of the VESA library, that contains optimized
functions for use fonts.