Patch Fonts

About

You may have seen some fonts with cursive italic styles, for example Operator Mono and Dank Mono.

But do you know you can patch your favorite fonts with cursive italics from these fonts? Like this:

Macon

This font is Monaco + MonoLisa, also patched with nerd font icons and ligatures.

The principle is very easy, let the regular font variants and italic font variants the same font family name.

In this post, I’m going to briefly explain how to do this.

Patch Nerd Font Icons

Make sure you have fontforge installed. Clone the repository via this command:

1
$ git clone --depth=1 https://github.com/ryanoasis/nerd-fonts.git

Then use this command to patch your fonts:

1
2
$ cd nerd-fonts
$ python ./font-patcher -s -l -c -ext ttf /path/to/your/font

Patch Ligatures

If your fonts don’t support ligatures, you can use ToxicFrog/Ligaturizer to patch them with ligatures. We can also use this tool to rename the fonts.

This tool also requires to have fontforge installed. Clone the repository via this command:

1
$ git clone --recurse-submodules https://github.com/ToxicFrog/Ligaturizer.git

Then you can patch the fonts via this command:

1
2
3
4
5
$ cd Ligaturizer
$ fontforge -lang py -script ligaturize.py /path/to/input/font.ttf \
    --prefix='' \
    --output-dir=/path/to/output/dir/ \
    --output-name='Name of Ligaturized Font'

Where 'Name of Ligaturized Font' is the name of patched fonts, make sure to have all your font variants the same name (Regular, Italic, Bold), so all of them will be regard as of the same font family.

Rename font

If your font already have ligatures and you don’t want to use Ligaturizer to override them, you can also use chrissimpkins/fontname.py to rename the fonts.

Install fonttools python module via this command:

1
$ pip3 install fonttools

And you can clone the repository and use the script like this:

1
2
3
$ git clone https://github.com/chrissimpkins/fontname.py.git
$ cd fontname.py
$ python3 fontname.py [NEW FONT FAMILY NAME] [FONT PATH 1] <FONT PATH ...>

Combinations

Here are some combinations that I think are very nice.

If you find it’s very hard to patch the fonts yourself, email me and I can send you these fonts that have been patched.


Agave + Dank Mono

Adove


Cascadia Code + Cartograph CF

Cascursive


Fira Code + Operator Mono

Fisa Code


Lilex + Operator Mono

Lexsa


Monaco + MonoLisa

Macon


Recursive Mono + Cartograph CF

Recursive


Inconsolata + Script12 BT

Inconsolata-iScript