2017-08-08 08:20:20 +03:00
# Ligaturizer #
2017-08-08 08:37:57 +03:00
2017-10-19 22:49:18 +03:00
![](images/banner.png)
2017-08-08 08:37:57 +03:00
2017-09-23 05:58:11 +03:00
**Add ligatures to any coding font!**
2017-10-19 22:49:18 +03:00
**This repo contains 2 things:**
2017-09-23 05:58:11 +03:00
1. Programming fonts with ligatures added (in `output-fonts/` ), including:
2017-10-16 03:36:08 +03:00
* [Anonymous Pro ](output-fonts/Anonymous_Pro.ttf )
* [CamingoCode ](output-fonts/CamingoCode.ttf )
* [Cousine ](output-fonts/Cousine.ttf )
* [DejaVu Sans Mono ](output-fonts/DejaVuSansMono.ttf )
* [Droid Sans Mono ](output-fonts/DroidSansMono.ttf )
* [edlo ](output-fonts/edlo.ttf )
* [Hack ](output-fonts/Hack.ttf )
* [Inconsolata ](output-fonts/Inconsolata.ttf ) & [Inconsolata-g ](output-fonts/Inconsolata-g.ttf )
* IBM Plex Mono: [Regular ](output-fonts/IBMPlexMono.ttf ), [Semibold ](output-fonts/IBMPlexMono-SemiBold.ttf )
* Meslo ([LGL](output-fonts/MesloLGL.ttf), [LGLDZ ](output-fonts/MesloLGLDZ.ttf ), [LGM ](output-fonts/MesloLGM.ttf ), [LGMDZ ](output-fonts/MesloLGMDZ.ttf ), [LGS ](output-fonts/MesloLGS.ttf ), [LGSDZ ](output-fonts/MesloLGSDZ.ttf ))
* [Oxygen Mono ](output-fonts/OxygenMono.ttf )
* [Roboto Mono ](output-fonts/RobotoMono.ttf )
* SF Mono: [Regular ](output-fonts/SFMono.ttf ), [Semibold ](output-fonts/SFMono-Semibold.ttf )
* [Ubuntu Mono ](output-fonts/UbuntuMono.ttf )
2017-10-19 22:49:18 +03:00
2. A fontforge python script ([ligaturize.py](ligaturize.py)) that adds the ligatures from [Fira Code ](https://github.com/tonsky/FiraCode ) to a font without ligatures
2017-08-08 08:20:20 +03:00
2017-10-19 22:49:18 +03:00
Here's a couple examples of the fonts generated: SF Mono with ligatures (note the `!=` and `->` ):
![](images/sf-mono.png)
![](images/menlo.png)
**Credit**
This awesome script was written by [IlyaSkriblovsky ](https://github.com/IlyaSkriblovsky ) for adding ligatures to Deja Vu Sans Mono ([dv-code-font](https://github.com/IlyaSkriblovsky/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.
2017-08-08 08:20:20 +03:00
## Requirements ##
2017-10-19 22:49:18 +03:00
**Using the Fonts**: See the [FiraCode README ](https://github.com/tonsky/FiraCode ) for a list of supported editors.
2017-08-08 08:20:20 +03:00
**Script**: This script requires FontForge python bindings. For Debian/Ubuntu they are available in `python-fontforge` package. For macOS,
they are available via brew (`brew install fontforge`).
## Using the Script ##
2017-09-23 05:58:11 +03:00
1. Move/copy the font you want to ligaturize into `input-fonts/`
2017-08-08 08:20:20 +03:00
2. Run the script: `$ fontforge -lang=py ligaturize.py`
2017-10-19 22:49:18 +03:00
3. You'll be prompted for the name of the font, and the name for the generated font.
Example:
2017-08-08 08:20:20 +03:00
2017-09-23 05:58:11 +03:00
```shell
❯ fontforge -lang=py ligaturize.py
...
Enter the source font filename (including extension): RobotoMono-Regular.ttf
Enter a name for your ligaturized font -- or press ENTER to use the same name: < PRESS ENTER >
...
Generated ligaturized font Roboto Mono L in ligaturized-fonts/RobotoMono.ttf
2017-08-08 08:20:20 +03:00
```
2017-09-23 05:58:11 +03:00
```shell
2017-08-08 08:20:20 +03:00
❯ fontforge -lang=py ligaturize.py
...
Enter the source font filename (including extension): RobotoMono-Regular.ttf
Enter a name for your ligaturized font -- or press ENTER to use the same name: RobotoMonoL
...
Generated ligaturized font Roboto Mono L in ligaturized-fonts/RobotoMonoL.ttf
```
If you don't provide a name for the new font, it will have the same name as the input font.
## Misc. ##
For more awesome programming fonts with ligatures, check out:
1. [FiraCode ](https://github.com/tonsky/FiraCode )
2. [Hasklig ](https://github.com/i-tu/Hasklig )