Setting Fonts

Particularly in an application such as a dictionary reader it is necessary to set up fonts for use with various languages. The following two sections will provide you with some basic information about how Java handles fonts, and how you can change Babbletower's particular font settings.

Java and Fonts

For reasons of cross-platform compatibility, Java uses virtual fonts. A virtual font is made up of one or more real fonts. The logical names of these virtual fonts are:

Fonts present in the underlying OS have to be mapped to these logical names. How this is done, again depends on the runtime environment and also the OS it's running on. For this reason, concrete instructions on how to set up fonts for your particular Java runtime cannot be given here. Instead, I'll try to provide pointers to instructions for font setup for different runtime environments. If you've solved a tricky font setup problem, and you want to share your findings here with other Babbletower users, please contact me.

Sun Java Runtimes

Here, font mappings are defined in a font.properties file that resides in the lib subdirectory of the runtime's install directory. Adding Fonts to the Java Runtime at Sun explains the details of this file for their 1.1.x runtimes, on Solaris and Windows OS. The same format also applies to Sun's PersonalJava runtime environment for Windows CE, and seems to have been adopted by other vendors' runtimes as well.

Insignia Jeode on Sharp SL-5x00

The Insignia Jeode runtime -at least on the Sharp SL-5x00 PDA- uses fonts in a way that is not fully compatible with virtual fonts: The default mappings for the virtual fonts appearantly are hard wired and cannot be changed. To make up for this, Java applications can call fonts directly by their system names in Jeode. This is done in a way compatible with J2ME (Java 2 Micro Edition), but not PersonalJava, so it pretty much blows cross-platform compatibility for programs relying on the virtual font concept and the ability to change virtual font mappings, such as Babbletower. You cannot set them up to use other than the fonts mapped by default, unless you change program code...

If anyone has found that after all there is a way to set font mappings, please let me know!

To counter this, you can specify font mappings in Babbletower's properties file. Note that this is only provided for use with the above mentioned runtime. It has only been tested there so far, on an SL-5500. It will most likely not work at all on any other runtime!. Only one real font can be mapped to each virtual font.

You can also try to directly use Babbletower's font settings, explained below, to only map fonts at particular places in the user interface.

Setting Up Babbletower's Fonts

You can place configuration information for font usage in Babbletower in the optional properties file. A font setup has the following format:

{device key}.font.{setting name} = {font name}, {style}, {size}
Babbletower currently recognizes these setting names:

setting namedefault valuedescription
default
SansSerif, plain, 10
default font
menus
SansSerif, plain, 11
font for all menus
wblist.stats
Monospaced, plain, 10
font for wordbox list when showing statistics
wblist.nostats
SansSerif, plain, 12
font for wordbox list without statistics
card.verybig
SansSerif, plain, 18
largest font for flash cards, used by heading field
card.big
SansSerif, plain, 14
large font for flash cards, used by reading and translation fields
card.small
SansSerif, plain, 10
small font for flash cards, used by explanation and remark fields
card.kanji
SansSerif, plain, 42
extra large font for flash cards, used for Kanji display
dictio.field
SansSerif, plain, 14
font for the lookup field in the dictionary screen
dictio.history
SansSerif, plain, 12
font for the history list in the dictionary screen
dictio.page
SansSerif, plain, 14
font for lookup result screen ("dictionary page") in the dictionary screen
lupe
SansSerif, plain, 48
font for the lupe
zoom
none Globally scale font size settings. Specify this value in percent. E.g.:

  pc.font.zoom = 30
  pda.font.zoom = -10

The first setting increases all font sizes by 30% for device key pc, the second one decreases them for device key pda. Note that the sizes of all other font configurations are not affected by this setting.

Remarks:

Examples:

zaurus.font.default = SansSerif, bold italic, 14
zaurus.font.dictio.page = *, *, 12
zaurus.font.dictio.field = Unifont, *, 12

Back to top of manual