Hi OldSpring,
There is NO problem with XGlcd nor with the fonts. You are suffering from a "traditional" problem that all users of "
PROPORTIONAL" fonts face first time. I already posted details of this behaviour on XGLCD Forum. here is the details again on this forum. This may be helpfull for other users:
What you are experiencing is not a bug, it's a misunderstanding of the side effects of using
Proportional width fonts.
All chars
have NOT the same width, not like fixed font width provided with original mE GLCD Lib.
So if you draw 0, and draw 1 on top of it, even if the transparency is not set, the "0" is wider than "1" (more pixels in x direction), so drawing "1" will not completely erase "0" pixels.
Now When you draw a blank line on top of chars, blanks (char #32) will also not have the same width of "0" or "W" ... sot this also not is the correct way to do it.
The solution:
I gave an example with the lib that shows a counter... and it works fine
the functions xGLCD_Write_text() and xGLCD_Write_Char() have a parameter
COLOR (last param) that says if we must set/clear/invert pixels.
You have to draw a text with the color xColorSet (=1)
You have to erase it NOT by drawing Blanks, but by drawing the SAME TEXT with xColorClear (=0) ... this garantee that you have deleted all chars and thus cleared all their pixels...
and thus you can draw the new text ....
Code: Select all
while (1==1) // infinite loop
{
// we get time
currentTimeText = ...... <<< Some text like a counter for example
// we draw time
xGlcd_Write_Text(currentTimeText, 20, 20, xColorSet);
delayms(1000) ....
// we delete/erase our time by drawing the same text in xColorClear mode.
xGlcd_Write_Text(currentTimeText, 20, 20, xColorClear);
// we are ready for next loop.
}
xColorSet and xColorClear are constants defined in xglcd_lib.
You should have a deep look at the last loop in the example project I gave with XGlcd Lib.
Regards
Octal