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

This package provides a programming library and a command line interface for conversion, creation and manipulation of TrueType retro fonts.

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

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. In Wayland we can use foot as follows.

foot -f MSX

In X, we can use xterm.

xterm -fa MSX
https://raw.githubusercontent.com/jfjlaros/retrofont/master/docs/images/msx_normal.png

Plain text mixed with MSX characters.

The -p option additionally uses the converted font as 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

Primary font using the MSX character set.

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

Not a screenshot of a Commodore 64 emulator.

Creation

Glyphs can be drawn by hand and put in a YAML file.

- # ...
- - data:
    - ' #    # '
    - '  #  #  '
    - ' ###### '
    - '## ## ##'
    - '########'
    - ' ###### '
    - '#      #'
    - '###  ###'
    offset: 0
  # ...

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

Newly created glyph in the UTF-8 Private Use Area.

Please see ReadTheDocs for the latest documentation.