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

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.

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-1.0.0.tar.gz (754.6 kB view details)

Uploaded Source

Built Distribution

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

retrofont-1.0.0-py2.py3-none-any.whl (11.7 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: retrofont-1.0.0.tar.gz
  • Upload date:
  • Size: 754.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for retrofont-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a671c081abae5c1d879091bd20b2fcfc27fee07049c3f7f25066f8e37e3d481d
MD5 732718b61308caa1fe91e13b24092a95
BLAKE2b-256 6187d01492104638d2fdbff1150caae893503cd57accb60cc6dd0055e366e28b

See more details on using hashes here.

Provenance

The following attestation bundles were made for retrofont-1.0.0.tar.gz:

Publisher: release.yml on jfjlaros/retrofont

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: retrofont-1.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for retrofont-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d4e0969ee93a9864a94a7d6e61a96281a44bb4bd8b9cc5e68f00f88c5baa52a5
MD5 9a8310bf3c9da6db654076f69ad18e88
BLAKE2b-256 cd93365ab52b0fca67d1ff858c40b9c20603558985901a1a4ee8bce7317466fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for retrofont-1.0.0-py2.py3-none-any.whl:

Publisher: release.yml on jfjlaros/retrofont

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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