Update at 2023-11-23
In order to avoid potential legal issues, I decided not to distribute these font files on the public website.
If you want to obtain these fonts, register an account on my gitea instance and send me an email, I’ll invite you to a private repository which contains all these font files and the source code.
TL;DR
Go ahead to https://git.sainnhe.dev/sainnhe/icursive-nerd-font, download the fonts you like.
git.sainnhe.dev is hosted on Raspberry Pi 4B, it may not be available at all times. There is also a read-only mirror hosted on GitHub which can be considered as an alternative source: https://github.com/sainnhe/icursive-nerd-font.
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:
This font uses the regular variant of Monaco and the italic variant of MonoLisa, also patched with nerd font icons and ligatures.
The principle is very simple, 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.
Setup Environment
In this post, I assume that you are using a Linux operating system and have basic knowledge of command line.
First of all, you need to clone the repository:
1
|
$ git clone --depth=1 https://git.sainnhe.dev/sainnhe/icursive-nerd-font.git
|
This repository contains my modified version of Nerd Font Patcher and Ligaturizer, we will use them to patch our fonts later.
To use these two utilities, you need to have Python and FontForge installed.
In the following steps, we’ll also use a command fc-scan
to analyze fonts, this tool is available in https://gitlab.freedesktop.org/fontconfig/fontconfig, you can use your package manager to install it, generally the package name is fontconfig
.
In this post, we’ll give an example of patching the regular variants of Fira Code and italic variants of Operator Mono to a new font named “Fisa Code”, make sure you have the font files of these two fonts.
Rename Fonts
To combine these two fonts, all we need to do is simply rename them to the same font family name.
To start with, let’s use fc-scan
to check their current font family:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
$ fc-scan -b /path/to/fira-code-regular
Pattern has 25 elts (size 32)
family: "Fira Code"(s)
familylang: "en"(s)
style: "Regular"(s)
stylelang: "en"(s)
fullname: "Fira Code Regular"(s)
fullnamelang: "en"(s)
slant: 0(i)(s)
weight: 80(f)(s)
width: 100(f)(s)
spacing: 100(i)(s)
foundry: "CTDB"(s)
file: "fira/FiraCode-Regular.ttf"(s)
index: 0(i)(s)
outline: True(s)
scalable: True(s)
fontversion: 393347(i)(s)
capability: "otlayout:DFLT otlayout:cyrl otlayout:grek otlayout:latn otlayout:zinh otlayout:zyyy"(s)
fontformat: "TrueType"(s)
decorative: False(s)
postscriptname: "FiraCode-Regular"(s)
color: False(s)
symbol: False(s)
variable: False(s)
fonthashint: True(s)
order: 0(i)(s)
$ fc-scan -b /path/to/operator-mono-book-italic
Pattern has 25 elts (size 32)
family: "Operator Mono"(s) "Operator Mono Book"(s)
familylang: "en"(s) "en"(s)
style: "Book Italic"(s) "Italic"(s)
stylelang: "en"(s) "en"(s)
fullname: "Operator Mono Book Italic"(s)
fullnamelang: "en"(s)
slant: 100(i)(s)
weight: 52.5(f)(s)
width: 100(f)(s)
spacing: 100(i)(s)
foundry: "H&Co"(s)
file: "operator/OperatorMono-BookItalic.otf"(s)
index: 0(i)(s)
outline: True(s)
scalable: True(s)
fontversion: 65667(i)(s)
capability: "otlayout:DFLT otlayout:latn"(s)
fontformat: "CFF"(s)
decorative: False(s)
postscriptname: "OperatorMono-BookItalic"(s)
color: False(s)
symbol: False(s)
variable: False(s)
fonthashint: False(s)
order: 0(i)(s)
|
Notice the lines started with family:
, we are going to modify them to the same value “Fisa Code”.
Although there are tools available specifically for naming fonts, but we don’t need to use them here, because we also want to patch them with nerd font symbols and ligatures and my modified version of Nerd Font Patcher and Ligaturizer already support this feature, we’ll rename the fonts by the way while patching nerd font symbols and ligatures.
Patch Nerd Font Symbols
cd
to /path/to/icursive-nerd-font/nf
and execute the following commands:
1
2
|
$ ./font-patcher.py /path/to/fira-code-regular
$ ./font-patcher.py /path/to/operator-mono-book-italic
|
We’ll get two files Fira Code Regular.ttf
and Operator Mono Book Italic.ttf
, let’s check the font family name of them:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
$ fc-scan -b Fira\ Code\ Regular.ttf
Pattern has 25 elts (size 32)
family: "Fira Code"(s)
familylang: "en"(s)
style: "Regular"(s)
stylelang: "en"(s)
fullname: "Fira Code Regular"(s)
fullnamelang: "en"(s)
slant: 0(i)(s)
weight: 80(f)(s)
width: 100(f)(s)
spacing: 100(i)(s)
foundry: "CTDB"(s)
file: "Fira Code Regular.ttf"(s)
index: 0(i)(s)
outline: True(s)
scalable: True(s)
fontversion: 393347(i)(s)
capability: "otlayout:DFLT otlayout:cyrl otlayout:grek otlayout:latn otlayout:zinh otlayout:zyyy"(s)
fontformat: "TrueType"(s)
decorative: False(s)
postscriptname: "FiraCode-Regular"(s)
color: False(s)
symbol: False(s)
variable: False(s)
fonthashint: True(s)
order: 0(i)(s)
$ fc-scan -b Operator\ Mono\ Book\ Italic.ttf
Pattern has 25 elts (size 32)
family: "Operator Mono"(s) "Operator Mono Book"(s)
familylang: "en"(s) "en"(s)
style: "Book Italic"(s) "Italic"(s)
stylelang: "en"(s) "en"(s)
fullname: "Operator Mono Book Italic"(s)
fullnamelang: "en"(s)
slant: 100(i)(s)
weight: 52.5(f)(s)
width: 100(f)(s)
spacing: 100(i)(s)
foundry: "H&Co"(s)
file: "Operator Mono Book Italic.ttf"(s)
index: 0(i)(s)
outline: True(s)
scalable: True(s)
fontversion: 65667(i)(s)
capability: "otlayout:DFLT otlayout:latn"(s)
fontformat: "TrueType"(s)
decorative: False(s)
postscriptname: "OperatorMono-BookItalic"(s)
color: False(s)
symbol: False(s)
variable: False(s)
fonthashint: False(s)
order: 0(i)(s)
|
Ok, they didn’t change. If you don’t pass any arguments to font-patcher.py
, it won’t change the family name and full name.
Let’s run again with the following arguments:
1
2
|
$ ./font-patcher.py --family-name "Fisa Code" --full-name "Fisa Code Regular" /path/to/fira-code-regular
$ ./font-patcher.py --family-name "Fisa Code" --full-name "Fisa Code Italic" /path/to/operator-mono-book-italic
|
We’ll get two fonts Fisa Code Regular.ttf
and Fisa Code Italic.ttf
, let’s check their family name now:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
$ fc-scan -b Fisa*
Pattern has 25 elts (size 32)
family: "Fisa Code"(s) "Operator Mono Book"(s)
familylang: "en"(s) "en"(s)
style: "Book Italic"(s) "Italic"(s)
stylelang: "en"(s) "en"(s)
fullname: "Fisa Code Italic"(s)
fullnamelang: "en"(s)
slant: 100(i)(s)
weight: 52.5(f)(s)
width: 100(f)(s)
spacing: 100(i)(s)
foundry: "H&Co"(s)
file: "Fisa Code Italic.ttf"(s)
index: 0(i)(s)
outline: True(s)
scalable: True(s)
fontversion: 65667(i)(s)
capability: "otlayout:DFLT otlayout:latn"(s)
fontformat: "TrueType"(s)
decorative: False(s)
postscriptname: "OperatorMono-BookItalic"(s)
color: False(s)
symbol: False(s)
variable: False(s)
fonthashint: False(s)
order: 0(i)(s)
Pattern has 25 elts (size 32)
family: "Fisa Code"(s)
familylang: "en"(s)
style: "Regular"(s)
stylelang: "en"(s)
fullname: "Fisa Code Regular"(s)
fullnamelang: "en"(s)
slant: 0(i)(s)
weight: 80(f)(s)
width: 100(f)(s)
spacing: 100(i)(s)
foundry: "CTDB"(s)
file: "Fisa Code Regular.ttf"(s)
index: 0(i)(s)
outline: True(s)
scalable: True(s)
fontversion: 393347(i)(s)
capability: "otlayout:DFLT otlayout:cyrl otlayout:grek otlayout:latn otlayout:zinh otlayout:zyyy"(s)
fontformat: "TrueType"(s)
decorative: False(s)
postscriptname: "FiraCode-Regular"(s)
color: False(s)
symbol: False(s)
variable: False(s)
fonthashint: True(s)
order: 0(i)(s)
|
Great! Both of them have the same family name Fisa Code
.
Patch Ligatures
Since Fira Code already has nice support for ligatures, we only need to patch the italic variants of Operator Mono.
cd
to /path/to/icursive-nerd-font/liga
and execute the following command:
1
|
$ ./ligaturize.py ../nf/Fisa\ Code\ Italic.ttf --family-name "Fisa Code" --full-name "Fisa Code Italic"
|
We’ll get a file OperatorMono-BookItalic.ttf
, let’s check the font family of it:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
$ fc-scan -b OperatorMono-BookItalic.ttf
Pattern has 25 elts (size 32)
family: "Fisa Code"(s)
familylang: "en"(s)
style: "Book Italic"(s) "Italic"(s)
stylelang: "en"(s) "en"(s)
fullname: "Fisa Code"(s) "Fisa Code Italic"(s)
fullnamelang: "en"(s) "en"(s)
slant: 100(i)(s)
weight: 52.5(f)(s)
width: 100(f)(s)
spacing: 100(i)(s)
foundry: "H&Co"(s)
file: "OperatorMono-BookItalic.ttf"(s)
index: 0(i)(s)
outline: True(s)
scalable: True(s)
fontversion: 65667(i)(s)
capability: "otlayout:DFLT otlayout:arab otlayout:armn otlayout:cyrl otlayout:geor otlayout:grek otlayout:lao otlayout:latn otlayout:math otlayout:thai"(s)
fontformat: "TrueType"(s)
decorative: False(s)
postscriptname: "OperatorMono-BookItalic"(s)
color: False(s)
symbol: False(s)
variable: False(s)
fonthashint: False(s)
order: 0(i)(s)
|
Nice! So we have OperatorMono-BookItalic.ttf
in /liga
directory and Fisa Code Regular.ttf
in /nf
directory, these are our target fonts.
Copy these two files to a new directory and rename the files. Install them on your system and enjoy 🚀