Search the web
Sign In
New User? Sign Up
palm-dev-forum
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Weird FntDefineFont problem   Message List  
Reply | Forward Message #68856 of 92429 |
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/



Sat Feb 23, 2002 1:07 am

dave@...
Send Email Send Email

Forward
Message #68856 of 92429 |
Expand Messages Author Sort by Date

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...
Dave Carrigan
dave@...
Send Email
Feb 23, 2002
1:09 am

Hi David, ... A bug was fixed on 11/18/98 (first built as part of Palm OS 3.2) in FntDefineFont, where if the app defined font table had to grow, then a low...
Ken Krugler
ken@...
Send Email
Feb 24, 2002
12:57 am

... Yes this is the bug. I was originally using 150 and was seeing the problem, so I switched to 192 like my legacy app was using, but no use. You are correct...
Dave Carrigan
dave@...
Send Email
Feb 24, 2002
6:05 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help