Copy the ligatures (glyphs and rendering information) from Fira Code v3.1 into any other TrueType or OpenType font.
Note
The ligatures are scale-corrected, but otherwise copied as is from Fira Code; it doesn't create new ligature graphics based on the font you're modifying.
Python = 3.12withfontforgepython bindings- For Debian/Ubuntu they are available in
python3-fontforgepackage. - For OpenSUSE and NixOS, they are included in the
fontforgepackage. - For macOS, they are available via brew (
brew install fontforge).
- For Debian/Ubuntu they are available in
You can download the latest stable version or
the nightly build (edge version).
Once downloaded, the binary can be run from anywhere. Ideally, though, you should move it into your $PATH for easy use. /usr/local/bin is a popular location for this.
If you want to build from source, run make build, the binary will be available at ./out/ligaturizer.
$ ligaturizer /path/to/font-file
--ligature-font-file /path/to/firacode-v3-otf-font-file \For example:
$ ligaturizer /opt/fonts/DejaVuSansMono.ttf \
--ligature-font-file /opt/fonts/FiraCode3/otf/FiraCode-Regular.otf \Note
If you don't provide a ligature font file, you must specify the --ligature-font-dir option, point it to the directory that contains the FiraCode OTF font files. For example:
$ ls -1 /opt/fonts/FiraCode3/otf/
FiraCode-Bold.otf
FiraCode-Light.otf
FiraCode-Medium.otf
FiraCode-Regular.otf
FiraCode-Retina.otf
FiraCode-SemiBold.otfThe tool will pick a font file corresponding to the weight of the input font file.
The ligaturized font will be generated in the current working directory. If you want to specify the output directory, use --output-dir option.
For all available options, run:
$ ligaturizer -hIf you have problem with installing fontforge or python3.12, you can use the docker version instead. You don't have to specify the --ligature-font-file or --ligature-font-dir option, the docker image already contains the FiraCode font files.
$ docker run --rm \
-v /path/to/local/font-dir:/opt/fonts/output \
-w /opt/fonts/output \
ghcr.io/nhatthm/ligaturizer:latest DejaVuSansMono.ttfGo >= 1.24withcgoenabledgolangci-lint >= 1.55.2(optional)Python = 3.12withfontforgepython bindings
- The ligaturize script was originally written by IlyaSkriblovsky for adding ligatures to DejaVuSans Mono (dv-code-font).
- Navid Rojiani made a few changes to generalize the script so that it works for any font.
- ToxicFrog made a large number of contributions with the Ligaturizer project.
- Nhat has ported the project to Golang with some improvements.
Contributions always welcome! Please submit a Pull Request, or create an Issue if you have an idea for a feature/enhancement (or bug).
For more awesome programming fonts with ligatures, check out:
