2 * font2b.c - convert linux console 8x8 font data to betty lcd ram layout
4 * author: hackbard@hackdaworld.org
8 * first you have to adjust this file two times (see comments!)
9 * don't forget to rebuild.
11 * ./font2b > default_font.h
13 * ONLY 8x8 FONTS SUPPORTED!
19 #include <sys/types.h>
24 // put your font data here!
25 #include "/usr/src/linux/drivers/video/console/font_pearl_8x8.c"
30 int main(int argc,char **argv) {
32 unsigned char *font_data;
38 // adjust the font data pointer here!
39 font_data=(unsigned char *)fontdata_pearl8x8;
43 fd=open(argv[1],O_WRONLY|O_CREAT);
52 printf("const unsigned char default_font[%d]={\n",256*8);
54 for(font=0;font<=0xff;font++) {
56 /* print the font number */
58 printf("\t/* %d 0x%02x",font,font);
59 if((font>0x1f)&(font<0x7f))
60 printf(" %c */\n",font);
65 /* print the array content of the font */
66 for(col=0;col<8;col++) {
68 for(row=0;row<8;row++)
69 buf|=(((font_data[font*8+row]>>(7-col))&1)<<row);
74 if((font!=0xff)|(col!=7))