Example

font.softButton = bitmap_font.properties font.system.bold.medium = bold_font.properties

A font property file contains definitions for the following properties:

font_image = <image_filename> font_height = <pixel_height_font> font_ascent = <pixel_ascent_font> font_descent = <pixel_descent_font> font_leading = <pixel_space_between_lines_of_text>

The first property, font_image, refers to an image file, in PNG, GIF or JPEG format, that contains the font bitmap. The form of the bitmap should be a row of characters, as shown in FIGURE 4.

The other properties listed above define other characteristics of the font:

height—the height of a character

ascent—the part of the character that is above the base line

descent—the part of a character that is below the base line

leading—the spacing between lines

For a complete description of height, ascent, descent and leading as they relate to fonts, see

http://java.sun.com/j2se/1.4/docs/api/java/awt/FontMetrics.html

The bitmap font property file contains a list of properties of the form:

ascii_x-<n> = <horizontal pixel location in the image>

where <n> is a number between 0 and 256, and the given pixel location refers to the start of that character's definition in the font bitmap. The characters must be adjacent in the image, so that one character ends where another begins. The following image shows the interpretation of the horizontal pixel locations:

ASCII character

Distance to character

FIGURE 4 Specifying Emulator Fonts

Example

ascii_x-0 = 0 ascii_x-1 = 0

..

ascii_x-32 = 0 ascii_x-33 = 8

Chapter 3 Examining Device Property Files 21

Page 35
Image 35
Sun Microsystems Computer Accessories manual Ascii character Distance to character