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. |
||
---|---|---|
fira | ||
images | ||
input-fonts | ||
output-fonts | ||
.gitignore | ||
ligatures.py | ||
ligaturize.py | ||
Makefile | ||
README.md |
Ligaturizer
Add ligatures to any coding font!
This repo contains 2 things:
- Programming fonts with ligatures added (in
output-fonts/
), including:
- Anonymous Pro
- CamingoCode
- Cousine
- DejaVu Sans Mono
- Droid Sans Mono
- edlo
- Hack
- Inconsolata & Inconsolata-g
- IBM Plex Mono: Regular, Semibold
- Meslo (LGL, LGLDZ, LGM, LGMDZ, LGS, LGSDZ)
- Oxygen Mono
- Roboto Mono
- SF Mono: Regular, Semibold
- Ubuntu Mono
- 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)
- Put the font(s) you want into
input-fonts/
. - 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. - Run
make
. - Retrieve the ligaturized fonts from
output-fonts/
.
Using the Script (manual)
- Move/copy the font you want to ligaturize into
input-fonts/
(or somewhere else convenient). - 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. - 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: