RetroFont: TrueType font generator

https://img.shields.io/github/last-commit/jfjlaros/retrofont.svg https://readthedocs.org/projects/retrofont/badge/?version=latest https://img.shields.io/github/release-date/jfjlaros/retrofont.svg https://img.shields.io/github/release/jfjlaros/retrofont.svg https://img.shields.io/pypi/v/retrofont.svg https://img.shields.io/github/languages/code-size/jfjlaros/retrofont.svg https://img.shields.io/github/languages/count/jfjlaros/retrofont.svg https://img.shields.io/github/languages/top/jfjlaros/retrofont.svg https://img.shields.io/github/license/jfjlaros/retrofont.svg
https://raw.githubusercontent.com/jfjlaros/retrofont/master/docs/images/invader.png

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
https://raw.githubusercontent.com/jfjlaros/retrofont/master/docs/images/msx_normal.png

The -p option will make the converted font the primary font. It will also make the characters square and it will remove line spacing.

https://raw.githubusercontent.com/jfjlaros/retrofont/master/docs/images/msx_primary.png

Adjusting the terminal foreground and background colours can have quite a convincing effect.

https://raw.githubusercontent.com/jfjlaros/retrofont/master/docs/images/c64_boot.png

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
https://raw.githubusercontent.com/jfjlaros/retrofont/master/docs/images/msx_show.png

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
https://raw.githubusercontent.com/jfjlaros/retrofont/master/docs/images/test_font.png

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.