Although we can download a font from the Internet, the file must be in a format that is usable by mmbasic. That is where bdf2fnt becomes useful.
BDF fonts are a common file format used by X11. We can use the bdf font if we first download & convert it into a format usable by mmbasic. bdf2fnt is a php
script that will read a bdf font file and create 4 new files.
Why 4 files?
Many fonts have 256 (0-255) symbols defined. Due to design decisions of mmbasic, we can only load symbols with characters codes 32-127.
This does not represent a problem though because we can break up the font into 3 smaller groups of characters and load each file at runtime.
Note that in many cases, only the 1st file is actually needed for normal text.
Wait! You had said 4 files and now are saying 3 files; which is it 3 or 4??
To convert a bdf font, type the following Linux command: ./bdf2fnt fontname.bdf
4 files will be created
- fontname-symbols.txt -- Not usable by mmbasic. It is for humans to see ALL available symbols in a font
- fontname.fnt -- mmbasic loadable font containing symbols 32-126
- fontname-p2.fnt -- mmbasic loadable font containing symbols 160-254
- fontname-p3.fnt -- mmbasic loadable font containing symbols 1-32 & 128-159