Welcome back to the fourth and last part of the TamsPalm FontBucket tutorial. In case you missed the last part-it is right here.

Today, we will cover a few random thingies that can come in helpful:

Compatibility whenn FontBucket is not installed
FontBucket was developed to transparently “forward” FontBucket calls to the Palm OS API when FontBucket is not detected. So, as long as you didnt forget to include the resources into your XRD file, there is no need to create an own non-Fontbucket version!

Selecting a font
Selecting a font with FontBucket is as easy as selecting a font with the regular Palm OS. However, the selector is NOT HiRes+ cabable and obviously returns a FmFontID. This code snippet is not HiRes+ enabled and uses a selector trigger to display the font name in the currently selected font:

char* p=(char*)MemPtrNew(1024);
FontID font;
FmSelectFont(&fontbucket, &prefs.text.font);
FmFontName(&fontbucket, prefs.text.font, p);
FmUseFont(&fontbucket,prefs.text.font, &font);
CtlGlueSetFont(getObjectPtr(pForm, CmdFont),font);
CtlSetLabel(getObjectPtr(pForm, CmdFont),p);

Reacting to font deletition
Important-if you don’t apply the bug fix described here, this WILL NOT work
Eventually, fonts tend to get deleted. The following code snippet detects fonts that “went astray” and replaces them with the default Palm OS font:

//Check if font still lives
FmGetFMFontID(&fontbucket, stdFont, &prefs.text.font);

Overall, I hope that you enjoyed the TamsPalm FontBucket tutorial. Please tell us if you have questions or comments!!

Technorati tags:

Related posts:

  1. Compiling FontBucket with PODS Part 3
  2. Compiling FontBucket with PODS Part 2
  3. Compiling FontBucket with PODS 1.2
  4. Using FontBucket with OnBoardC
  5. OnBoardC and the glue library – changing control attributes

Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting

© 2013 TamsPalm - the Palm OS / web OS Blog Suffusion theme by Sayontan Sinha