Thread View: pilot.programmer
2 messages
2 total messages
Started by jms
Sun, 24 Aug 2003 17:56
Custom Font glitch after starting on Tungsten T world clock
Author: jms
Date: Sun, 24 Aug 2003 17:56
Date: Sun, 24 Aug 2003 17:56
15 lines
1997 bytes
1997 bytes
Hi,
I'm developing an app that happens to use a custom font. After starting a
Tungsten T device using the select button to look at world clock then
hitting OK my custom font is either drawn in the huge clock number
characters or is blank, also causes occasional crashes. Tried using a few
different Font IDs to avoid the problem and the effect varies slightly but
never works correctly.
Anyone come across this? Any good workarounds? Is there a notification I
should be looking for to reload my fonts?
Any help would be much appreciated,
Jody
Re: Custom Font glitch after starting on Tungsten T world clock
Author: Logan Shaw
Date: Mon, 25 Aug 2003 02:12
Date: Mon, 25 Aug 2003 02:12
38 lines
2808 bytes
2808 bytes
jms wrote:
> I'm developing an app that happens to use a custom font. After starting a
> Tungsten T device using the select button to look at world clock then
> hitting OK my custom font is either drawn in the huge clock number
> characters or is blank, also causes occasional crashes.
That sounds like a bug to me.
> Anyone come across this? Any good workarounds? Is there a notification I
> should be looking for to reload my fonts?
Since user-interaction is controlled by events on the Palm, one
workaround is to set or save the font at some point in the app's
main event loop. Your code has control while you're handling a
given event, so if you do that, there is no way an interloper
like the world clock could screw up the font on you.
Two ways spring to mind. One is to FntSetFont() every time at
the top of your form's event handler (if you only use the font
in one form and if you use no other font on that form). The
other way is to replace all calls to SysHandleEvent() with
FontPreservingSysHandleEvent():
Boolean FontPreservingSysHandleEvent (EventType *e)
{
FontID savedfont;
Boolean handled;
savedfont = FntGetFont ();
handled = SysHandleEvent (e);
FntSetFont (savedfont);
return handled;
}
I don't, though, if these repeated calls to FntSetFont() will slow
down event handling...
- Logan
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads