Thanks, I had to stray from your example for the following reasons, again i dont know if it's correct but its working.
#1) i needed to add the static, because i have 24 font types. so i have each font type in its own .h file and all 24 .h files in their own folder called "Fonts" then i just #include each one of these files regardless if i use them or not. If i don't use them the compiler does not bring them in so i never have to worry about making sure i included this one or that.
when i used Font14 style[3]= the name "style" caused naming problems in the rest of the font files. when i added the static in there, it allowed me to use the "Font12T[4] =". i could drop the "style" name altogether, so that helped there.
Code: Select all
struct Font12T_XySize
{
BYTE xSize;
BYTE ySize;
};
static struct Font12T
{
Font12T_XySize sizeInfo;
BYTE fontdata[24];
}
Font12T[4] =
{
/* Element 0x0010 - Char 0x0030 */
{{8, 12},{
0x00,0x00, /* ................ */
0x00,0x00, /* ................ */
0x00,0x00, /* ................ */
0x38,0x00, /* ..%%%........... */
0x44,0x00, /* .%...%.......... */
0x44,0x00, /* .%...%.......... */
0x44,0x00, /* .%...%.......... */
0x44,0x00, /* .%...%.......... */
0x44,0x00, /* .%...%.......... */
0x38,0x00, /* ..%%%........... */
0x00,0x00, /* ................ */
0x00,0x00 /* ................ */
}}
,
/* Element 0x0011 - Char 0x0031 */
{{8, 12},{
0x00,0x00, /* ................ */
0x00,0x00, /* ................ */
0x00,0x00, /* ................ */
0x10,0x00, /* ...%............ */
0x30,0x00, /* ..%%............ */
0x10,0x00, /* ...%............ */
0x10,0x00, /* ...%............ */
0x10,0x00, /* ...%............ */
0x10,0x00, /* ...%............ */
0x38,0x00, /* ..%%%........... */
0x00,0x00, /* ................ */
0x00,0x00 /* ................ */
}}
,
/* Element 0x0012 - Char 0x0032 */
{{8, 12},{
0x00,0x00, /* ................ */
0x00,0x00, /* ................ */
0x00,0x00, /* ................ */
0x38,0x00, /* ..%%%........... */
0x44,0x00, /* .%...%.......... */
0x04,0x00, /* .....%.......... */
0x08,0x00, /* ....%........... */
0x10,0x00, /* ...%............ */
0x20,0x00, /* ..%............. */
0x7C,0x00, /* .%%%%%.......... */
0x00,0x00, /* ................ */
0x00,0x00 /* ................ */
}}
,
/* Element 0x0013 - Char 0x0033 */
{{8, 12},{
0x00,0x00, /* ................ */
0x00,0x00, /* ................ */
0x00,0x00, /* ................ */
0x38,0x00, /* ..%%%........... */
0x44,0x00, /* .%...%.......... */
0x04,0x00, /* .....%.......... */
0x18,0x00, /* ...%%........... */
0x04,0x00, /* .....%.......... */
0x44,0x00, /* .%...%.......... */
0x38,0x00, /* ..%%%........... */
0x00,0x00, /* ................ */
0x00,0x00 /* ................ */
}}
};
BYTE x_size = Font12T[0].sizeInfo.xSize;
BYTE y_size = Font12T[0].sizeInfo.xSize;
BYTE* font_data = Font12T[0].fontdata;
iprintf("x[%d],y[%d]\r\n",x_size,y_size);