Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

BBFGEN map files

A map file defines how character values are mapped to glyphs in the font bitmap. The map file is generated by using a text file editor to map the character values to the glyphs. For example, if your font bitmap starts with a space character and the encoding is Unicode, your first entry in the map file would be 0X20. This assigns the first entry in the bitmap file as the character value 0X20.

You can also specify an undefined character (the one to be used to represent characters that are not otherwise mapped). For example, if your character set does not include a bitmap glyph for a large set of character values, you can specify a default glyph for the font to display.

Note: The undefined character defaults to 007F.

The map file consists of plain text, and you must use these parsing rules to create your map file.

  • For comments: Any # and all characters following the # are ignored. Empty lines are also ignored.
  • For character mapping: All other lines should begin with a character mapping, which contains one to three hexadecimal numbers. For example, the syntax is start[..end][=equiv]. If the end of the range is not given, it defaults to the start.

    Character mappings can be followed by descriptive text after intervening white space that will be ignored. One exception is the presence of the string "*UNDEFINED*", which indicates that the start character is the undefined character.

  • For repeating a glyph with multiple character values:
    • When an equivalent value is given, no unassigned glyphs are used. Instead, characters in the range are mapped to the equivalent character.
    • When an equivalent is absent, a glyph is assigned to each character.

Note: Characters may appear in any order, as ordering is relevant only to the order in which glyphs are assigned from the bitmap.

Note: Consecutive contiguous entries are handled as efficiently as a single range entry.