Article View: pilot.programmer
Article #17Re: Custom Font glitch after starting on Tungsten T world clock
From: 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
Technical Details
Message-ID:
<Vfe2b.26010$_Y5.528176@twister.austin.rr.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!xmission!news-out.spamkiller.net!propagator2-maxim!news-in.superfeed.net!news-west.rr.com!news.rr.com!cyclone.austin.rr.com!twister.austin.rr.com.POSTED!53ab2750!not-for-mailReferences:
<%_62b.1999$fu6.128@newssvr24.news.prodigy.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10baa0,d74ce525e7d5cb35 X-Google-Attributes: gid10baa0,public X-Google-Thread: 10c638,d74ce525e7d5cb35 X-Google-Attributes: gid10c638,public X-Google-ArrivalTime: 2003-08-24 19:12:06 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!xmission!news-out.spamkiller.net!propagator2-maxim!news-in.superfeed.net!news-west.rr.com!news.rr.com!cyclone.austin.rr.com!twister.austin.rr.com.POSTED!53ab2750!not-for-mail From: Logan Shaw <lshaw-usenet@austin.rr.com> User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: pilot.programmer,codewarrior.palm Subject: Re: Custom Font glitch after starting on Tungsten T world clock References: <%_62b.1999$fu6.128@newssvr24.news.prodigy.com> In-Reply-To: <%_62b.1999$fu6.128@newssvr24.news.prodigy.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Lines: 39 Message-ID: <Vfe2b.26010$_Y5.528176@twister.austin.rr.com> Date: Mon, 25 Aug 2003 02:12:05 GMT NNTP-Posting-Host: 66.68.160.44 X-Complaints-To: abuse@rr.com X-Trace: twister.austin.rr.com 1061777525 66.68.160.44 (Sun, 24 Aug 2003 21:12:05 CDT) NNTP-Posting-Date: Sun, 24 Aug 2003 21:12:05 CDT Organization: Road Runner - Texas