FntMaker is a handy little tool we created to convert fonts from Raster Font Editor to our own format, which can be used on Tibbo BASIC devices with the LCD object.
You can download FntMaker for free in our Programmable Software section.
fntmaker filename [cut] [cut] [cut] [cut] [spacewidth] [options]
filename should be without extension. filename.txt will be used for input. filename.bin will be used for output.
[cut] can be used up to 4 times. It defines the number of pixel rows/columns that will be removed from the imported bitmaps:
Use CTx to cut x bitmap rows from the top of the bitmap;
Use CBx to cut x bitmap rows from the bottom of the bitmap;
Use CLx to cut x bitmap rows from the left of the bitmap;
Use CRx to cut x bitmap rows from the right of the bitmap;
Note: for proportional fonts, cutting is done before eliminating unsued pixel columns from bitmaps.
[spacewidth] is used for proportional fonts *only*, and defines the width of the space character (code 20h). Format is SWx, where x is the width of the space character. This option does nothing for non-proportional fonts because they preserve original bitmap widths.
[options]:
H for horizontally packed, non-proportional font;
HP for horizontally packed, proportional font;
V for vertically packed, non-proportional font;
VP for vertically packed, proportional font;
Default values are no cutting, vertical, non-proportional, original space width.
FNTMAKER 15X21 CT1 HP SW15
This well convert 15×21.TXT to 15×21.bin. One row will be cut off the top of imported bitmaps. The output will be a horizontally packed, proportional font, and the width of the space character will be 15 pixels.
Your input .TXT file must consist of blocks, one blcok for each character. Each block starts with one descriptor line defining character code and height. Here is an example:
# Character 0x23 x21
23 is the hex code of the character.
21 is its decimal height in pixels.
The line must start with # Character 0x exactly – no extra spaces or changes. Lines that do not start as shown are ignored.
FntMaker looks for 0x and assumes the number behind it is the hex code of the character.
It then searches for the next 'x' and assumes the number behind it is the decimal height of the character.
A matching number of bitmap lines must follow the above. Here is an example:
# Character 0x30 48 8x8 pixels
.@@@@@@.
@.....@@
@....@.@
@...@..@
@..@...@
@.@....@
@@.....@
.@@@@@@.
The descriptor line above has more data, but FntMaker will only pick what it needs. There must be no other text lines between the character descriptor and bitmap lines.
Declared character height must match actual numbers of bitmap lines that follow.
ALL characters in the file must have the same height.
ALL bitmap lines of one character must have the same width.
Different characters may have different widths.
In bitmap lines, 'dots' or SPACES represent pixels that are OFF, all other characters represent pixels that are ON.