Programming Fonts with Ligatures added (& a script to add them to other fonts)
Go to file
Ben Kelly e7856e2027 Generate output fonts in-place.
If fontforge crashes or is otherwise interrupted, you can just regenerate
the font; I think the risk of leaving a half-generated font file around is
less than the risk of unexpectedly overwriting something in the current
working directory, which is what the previous behaviour did.
2018-01-22 20:15:28 -05:00
fira Infer ligature font weight from output name; update FiraCode fonts 2018-01-19 19:56:24 -05:00
images Updated README 2017-10-19 12:49:18 -07:00
input-fonts Add a Makefile and regenerate the output fonts using it. 2018-01-22 19:14:10 -05:00
output-fonts Rename output fonts to have "Liga" prefix; having the same name as the "real" fonts confuses the font selector. 2018-01-22 19:18:25 -05:00
.gitignore Initial commit 2017-08-07 22:21:10 -07:00
ligatures.py Update ligatures list with all ligatures from FC 1.204 2018-01-19 20:15:04 -05:00
ligaturize.py Generate output fonts in-place. 2018-01-22 20:15:28 -05:00
Makefile Rename output fonts to have "Liga" prefix; having the same name as the "real" fonts confuses the font selector. 2018-01-22 19:18:25 -05:00
README.md Add a Makefile and regenerate the output fonts using it. 2018-01-22 19:14:10 -05:00

Ligaturizer

Add ligatures to any coding font!

This repo contains 2 things:

  1. Programming fonts with ligatures added (in output-fonts/), including:
  1. A fontforge python script (ligaturize.py) that adds the ligatures from Fira Code to a font without ligatures

Here's a couple examples of the fonts generated: SF Mono with ligatures (note the != and ->):

Credit This awesome script was written by IlyaSkriblovsky for adding ligatures to Deja Vu Sans Mono (dv-code-font). I made a few changes to generalize the script so that it works for any font, so that I could add ligatures to my favorite fonts.

Requirements

Using the Fonts: See the FiraCode README for a list of supported editors.

Script: This script requires FontForge python bindings. For Debian/Ubuntu they are available in python-fontforge package. For OpenSUSE and NixOS, they are included in the fontforge package. For macOS, they are available via brew (brew install fontforge).

Using the Script (automatic)

  1. Put the font(s) you want into input-fonts/.
  2. Edit ligatures.py to disable any ligatures you don't want, and/or enable any (non-ligature) characters you want from Fira Code in addition to the ligatures.
  3. Run make.
  4. Retrieve the ligaturized fonts from output-fonts/.

Using the Script (manual)

  1. Move/copy the font you want to ligaturize into input-fonts/ (or somewhere else convenient).
  2. Edit ligatures.py to disable any ligatures you don't want, and/or enable any (non-ligature) characters you want from Fira Code in addition to the ligatures.
  3. Run the script: $ fontforge -lang=py ligaturize.py <INPUT> <OUTPUT>, e.g. $ fontforge -lang=py ligaturize.py input-fonts/Cousine-Regular.ttf output-fonts/CousineLigaturized-Regular.ttf

The font family and weight for the output font (as recorded in the file) will be automatically set based on the name; if the output is CousineLigaturized-Regular.ttf, the font family will be CousineLigaturized and the font weight will be Regular. If no weight is specified, Regular is the default.

Misc.

For more awesome programming fonts with ligatures, check out:

  1. FiraCode
  2. Hasklig