Add ligatures to any coding font. Ligaturizer is a FontForge Python script that copies the ligatures (glyphs and rendering rules) from Fira Code into any TrueType or OpenType font. The ligatures are scale-corrected but otherwise copied as is; no new ligature artwork is drawn to match the target font.
This fork adds the Fira Code 6.2 ligatures to Source Code Pro. Building it produces
LigaSrcPro-*.ttfin all weights and italics infonts/output/.
git clone --recurse-submodules https://github.com/yashLadha/Ligaturizer.git
cd Ligaturizer
makeThe ligaturized fonts are written to fonts/output/. make needs the Fira Code TTFs described in Requirements and stops with an error if they are missing. To fetch them and build in Docker in one step, without installing FontForge locally, run ./build-fonts.sh (see build-fonts.sh).
This fork's Source Code Pro in Regular (LigaSrcPro-Regular) and Italic (LigaSrcPro-It), with ligatures for -> and !=:
-
Submodules: the coding fonts and Fira Code are git submodules, so clone with
--recurse-submodules. -
Fira Code TTFs: by default the ligatures are read from
fonts/fira/distr/ttf/FiraCode-<Weight>.ttf, picked to match the input font's weight. The Fira Code 6.2 source checkout does not include these files; copy thettf/folder from the Fira Code 6.2 release zip there, or pass--ligature-font-file(see Manual).build-fonts.shdoes this for you. -
FontForge with Python bindings:
Platform Install Debian / Ubuntu fontforgeandpython3-fontforgepackagesopenSUSE, NixOS fontforgepackage (bindings included)macOS brew install fontforge -
fontTools for Python 3: used by
postprocess.py, whichmakeruns on every generated font.makefails if it is missing. -
Editor support: see the Fira Code README for editors that render ligatures.
As an alternative to installing these locally, use the Docker image.
- Put the font(s) you want to ligaturize in
fonts/. - Edit
ligatures.pyto comment out any ligatures you don't want, and/or enable individual (non-ligature) characters to copy from Fira Code. - Edit
build.pyand add a glob for your font(s) to one of:prefixed_fonts: the family name gets theLigaprefix (e.g.'FooFont*'covers every weight of FooFont).renamed_fonts: maps a glob to a new family name, for licenses that require modified fonts to be renamed.
- Run
make. - Collect the fonts from
fonts/output/.
| Target | Result |
|---|---|
make (without-characters) |
Ligatures only, in fonts/output/ |
make with-characters |
Ligatures plus Fira Code punctuation glyphs, in fonts/output-with-characters/ |
make all |
Both of the above |
make release |
clean, all, then zips both into LigaturizedFonts.zip and LigaturizedFontsWithCharacters.zip |
make clean |
Removes generated fonts and zips |
make fails loudly: it exits non-zero if the Fira Code TTFs are missing, if FontForge or build.py fails, or if postprocess.py fails on any generated font.
-
Copy the font you want to ligaturize into
fonts/(or anywhere convenient). -
Edit
ligatures.pyto comment out any ligatures you don't want. -
Run the script:
fontforge -lang=py -script ligaturize.py path/to/input/font.ttf \ --output-dir=path/to/output/dir/ \ --output-name='Name of Ligaturized Font'
For example, this produces fonts/output/LigaturizedCousine-Regular.ttf:
fontforge -lang=py -script ligaturize.py fonts/Cousine-Regular.ttf \ --output-dir=fonts/output/ \ --output-name='Ligaturized Cousine' \ --prefix=''
The weight/style suffix (e.g. -Regular) is kept from the input font, and the output is OTF if the input is OTF, TTF otherwise.
| Option | Description |
|---|---|
--output-dir DIR |
Directory to write the font to. Required; there is no default. |
--output-name NAME |
New family name, replacing the original. |
--prefix STR |
Prepended to the family name. Defaults to Liga, so it also applies with --output-name; pass --prefix='' to disable it. |
--ligature-font-file PATH |
Font to copy ligatures from. Defaults to the matching weight in fonts/fira/distr/ttf/. |
--copy-character-glyphs |
Also copy individual punctuation glyphs listed in ligatures.py, so they match the ligatures more closely. |
--scale-character-glyphs-threshold N |
When copying character glyphs, scale them horizontally if their width differs from the input font by at least this fraction. Default 0.1; 0 scales all, 2 effectively disables scaling. |
Run fontforge -lang=py -script ligaturize.py --help for the full help text.
The Dockerfile provides FontForge with its Python bindings, fontTools, make and zip, so nothing else needs to be installed on the host. The repo is bind-mounted into the container at run time, so check out the submodules first (see Requirements).
Build the image from the repo root:
docker build -t ligaturizer .Run the default build (equivalent to make). Running as your own uid/gid keeps the files in fonts/output/ from being owned by root:
docker run --rm -u "$(id -u):$(id -g)" -v "$PWD":/work ligaturizer
Run the unit tests instead of a build (they also run locally with plain python3, no FontForge needed):
docker run --rm -u "$(id -u):$(id -g)" -v "$PWD":/work ligaturizer \ python3 -m unittest discover -s tests -v
Any other make target works the same way, e.g. a full release zip:
docker run --rm -u "$(id -u):$(id -g)" -v "$PWD":/work ligaturizer make release
build-fonts.sh builds the fonts end to end with Docker, starting from a fresh clone, and can be run from any directory. It needs docker, git, curl and unzip. It:
- Initializes the
fonts/firaandfonts/source-code-prosubmodules. - Downloads the Fira Code 6.2 release and unpacks its TTFs into
fonts/fira/distr/ttf/, unless they are already there. - Builds the
ligaturizerimage and runs the build in it as your own uid/gid. - Exits non-zero unless the run produced new
LigaSrcPro-*.ttffiles infonts/output/, then lists them.
./build-fonts.sh
| Option | Description |
|---|---|
--target NAME |
Run make NAME in the container instead of the default build, e.g. all or release. The target must write LigaSrcPro-*.ttf to fonts/output/, or the output check fails. |
--skip-image |
Reuse an existing ligaturizer image instead of rebuilding it. |
--install |
Copy fonts/output/*.ttf into ~/Library/Fonts on macOS or ~/.local/share/fonts on Linux, then run fc-cache -f there if it is available. |
-h, --help |
Show usage. |
This fork does not publish releases. Upstream ToxicFrog/Ligaturizer releases offer pre-ligaturized fonts built with an older Fira Code; they do not include this fork's Fira Code 6.2 changes or the LigaSrcPro fonts.
Originally written by IlyaSkriblovsky to add ligatures to DejaVu Sans Mono (dv-code-font). Navid Rojiani generalized the script to work with any font, and ToxicFrog has made a large number of contributions.
Contributions are welcome. Open a pull request, or an issue for a bug or feature idea.
More programming fonts with ligatures:


