Skip to main content

TrueType retro fonts.

Project description

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

https://raw.githubusercontent.com/jfjlaros/retrofont/master/docs/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
https://raw.githubusercontent.com/jfjlaros/retrofont/master/docs/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 in turn 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
https://raw.githubusercontent.com/jfjlaros/retrofont/master/docs/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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

retrofont-0.0.2.tar.gz (2.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

retrofont-0.0.2-py2.py3-none-any.whl (16.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file retrofont-0.0.2.tar.gz.

File metadata

  • Download URL: retrofont-0.0.2.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for retrofont-0.0.2.tar.gz
Algorithm Hash digest
SHA256 3246b43ce826f6bc9dcc1f5633d6a1cc30e96629dc6e5e34bcc7b91d688b4e1d
MD5 aff1c41718bba99ce72bfe5eee3a3fc0
BLAKE2b-256 0a559c05480b59760ad1839b50452ccb5e39661ce91306c46ade1b79d6782508

See more details on using hashes here.

File details

Details for the file retrofont-0.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: retrofont-0.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for retrofont-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3d61444a7d5cfea8dd59e2bcf845cb05a274102cd1e7207cf4f118649c36062f
MD5 ebb33e046cac2f5bf2fb24ae7c4833ac
BLAKE2b-256 c3f91ae60eba184d1c0b085ce512d1765773b38edc7bc71e13595e8fcc040402

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page