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 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
_images/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.

_images/primary.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
_images/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 can be used to create a TrueType font.

retrofont yml2rom demo.yaml demo.rom
retrofont rom2ttf -d ~/.local/share/fonts/ demo demo.rom
fc-cache -f
_images/demo.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.