I have a legacy app that uses a special font for some of its
controls. Back then, I implemented this by defining the resource as
having font 0, then in the app I would do:
// At startup:
FntDefineFont(192, MemHandleLock(DmGetResource('NFNT', 192)));
// During frmOpenEvent:
ControlType* ctl = FrmGetObjectPtr(...);
ctl->font = 192;
This seemed to work fine.
Fast forward to today, and I have another app that uses a special font
in some of its controls. I implemented it this time by defining the
resource as having font 192, and calling FntDefineFont() before any
forms are loaded. This also works fine, on PalmOS 3.2 and above. On 3.0
and 3.1 the controls continue to use font 0. So, I decided to use the
same method as the legacy app, and changed my resource to use font 0,
and changed my code to do
// During frmOpenEvent:
ControlType* ctl = FrmGetObjectPtr(...);
CtlGlueSetFont(ctl, 192);
this also works fine on 3.2 and above, but still doesn't work on 3.0 and
3.1. Further experimenting showed that I could make it work with
CtlGlueSetFont(ctl, boldFont) and other system fonts, but wouldn't work
with any of my installed fonts.
Now here is where it gets really weird. I put both my legacy app and the
new app on pose running a 3.0 rom. After running the legacy app and
verifying it was using special fonts, I loaded the new app, and much to
my surprise, it was now working correctly. I did a reset, and the new app
reverted to the incorrect behavior. I ran the legacy app again, went
back to the new app, and it was working again, and it continues to work
fine until I reset the device. After a reset, it won't work until I
first run my legacy app. I don't even have to load a form in the legacy
app that uses a custom font; simply loading the app seems sufficient. It
also doesn't seem to make a difference whether I use the
define-the-font-in-the-resource method or I use the CtlGlueSetFont
method in the new app.
I'm pretty sure that it's not a problem with my application, since it
works fine on any ROM from 3.2 up to 4.1, and also works fine in the
simulator. There seems to be a bug with PalmOS 3.{0,1}, and my legacy
app is inadvertently triggering something that installs a work around,
at least until the Palm resets.
Any ideas?
--
Dave Carrigan (dave@...) | Yow! I'm not available for
UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-DNS | comment..
Seattle, WA, USA |
http://www.rudedog.org/ |
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/tech/support/forums/