RetroFont: TrueType font generator
This package provides a programming library and a command line interface for conversion, creation and showing of TrueType retro fonts.
Quick start
Convert from ROM
Download a character ROM (e.g., one from the MSX) and run the following command.
retrofont rom2ttf -d ~/.local/share/fonts/ MSX charset_international.raw
fc-cache -f
Open a new terminal that uses the newly created font.
foot -f MSX
The -p option will make the converted font the primary font. It will also
make the characters square and it will remove line spacing.
Adjusting the terminal foreground and background colours can have quite a convincing effect.
Testing
The character sets can be shown using the show subcommand. The first (and
usually only) character set is shown as follows.
retrofont show 0
Additional character sets are numbered 1, 2, etc. The primary character set has index -1.
Creation
Glyphs can be drawn by hand and put in a YAML file.
- - data:
- ' # # '
- ' # # '
- ' ###### '
- '## ## ##'
- '########'
- ' ###### '
- '# #'
- '### ###'
offset: 1
This file can be converted into a character ROM file, which in turn can be used to create a TrueType font.
retrofont yml2rom test_font.yaml test_font.rom
retrofont rom2ttf -d ~/.local/share/fonts/ test_font test_font.rom
fc-cache -f
Modifying fonts
A character ROM file can be converted to a human readable YAML file using the
rom2yml subcommand, in which te glyphs can be edited. The previously shown
yml2rom can then be used to create the modified character ROM file.
Please see ReadTheDocs for the latest documentation.