New code structure

master
Sainnhe Park 4 months ago
parent 5639d4cdba
commit 0ecd05632a

@ -1 +0,0 @@
Subproject commit 880152731626fe32f5d437617cd6a66c8f0ab213

@ -1 +0,0 @@
Subproject commit 420eeefe5909d6a700226eb69340b45edcad442d

5
.gitignore vendored

@ -1,5 +0,0 @@
*Op*
*Dk*
*Cg*
.cache
.mypy_cache

6
.gitmodules vendored

@ -1,6 +0,0 @@
[submodule ".cache/operator-mono-lig"]
path = .cache/operator-mono-lig
url = https://github.com/kiliman/operator-mono-lig.git
[submodule ".cache/fontname.py"]
path = .cache/fontname.py
url = https://github.com/chrissimpkins/fontname.py.git

@ -1,129 +0,0 @@
## About
This is a guide to patch `iCursive` font.
Before the start, you might want to see the final display effect(read on even if you don't want to do this), this requires terminal emulators that support using different font family in different font face. For example, use font A in normal and bold font face, and use font B in italic font face.
As far as I know, [alacritty](https://github.com/alacritty/alacritty) and [kitty](https://github.com/kovidgoyal/kitty) support this feature.
Say if you want to patch the [agave](https://github.com/agarick/agave) font with dank mono.
First of all, you need to know the font family of the agave font. The `fc-list` command in linux will list all installed font, so you can use this command to get the font family of a specific font.
```sh
fc-list | fzf # use fzf to filter the result
fc-list | grep -i 'agave' # or directly grep
```
Then you get this line:
```
/usr/share/fonts/TTF/agave-r.ttf: Agave:style=Regular
```
The font family is `Agave`.
Now get the font family of dank mono in the same way
```
$ fc-list | grep -i 'dank'
/home/sainnhe/.local/share/fonts/Dank Mono Italic.ttf: Dank Mono:style=Italic
/home/sainnhe/.local/share/fonts/Dank Mono Regular.ttf: Dank Mono:style=Regular
```
So the font family is `Dank Mono`.
Now you can combine them like this(assume you are using alacritty):
```yaml
# in ~/.config/alacritty/alacritty.yml
font:
# Normal (roman) font face
normal:
family: Agave
style: Regular
# Bold font face
bold:
family: Agave
style: Bold
# Italic font face
italic:
family: Dank Mono
style: Italic
# Point size
size: 13.0
```
![demo](https://user-images.githubusercontent.com/37491630/76618797-56095600-6521-11ea-81d6-4348514428ed.png)
> color scheme: [gruvbox-material](https://github.com/sainnhe/gruvbox-material) using `mix` palette
## Patch nerd font icons
As you can see, in the screenshot above, the nerd font symbols in the status line look wired. To be precise, this should be called powerline font, because I think this font only patched powerline symbols instead of nerd font symbols. Btw, many fonts only patched powerline symbols, you need to patch nerd font symbols even if some symbols can be displayed.
There is another reason to patch nerd font symbols: some wired symbols can be fixed if it's patched. So it's recommended to patch it.
Edited: I just found this font is already patched in the official repository of [nerd-fonts](https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/Agave), you can use it directly.
You can follow the official guide to patch it: [Nerd Fonts Patcher](https://github.com/ryanoasis/nerd-fonts#font-patcher)
In short:
```sh
$ git clone --depth 1 https://github.com/ryanoasis/nerd-fonts.git
$ cd /path/to/nerd-fonts
$ ./font-patcher --mono -w -c -ext ttf /path/to/agave-r.ttf
$ ./font-patcher --mono -w -c -ext ttf /path/to/agave-b.ttf
```
## Add Ligatures
If you want to add ligatures to this font, you can use [ToxicFrog/Ligaturizer](https://github.com/ToxicFrog/Ligaturizer).
Alternatively, for operator mono, you can use [kiliman/operator-mono-lig](https://github.com/kiliman/operator-mono-lig).
This step is optional, but recommended.
## Patch iCursive font
The principle is very simple: rename the fonts to the same font family.
You can use [chrissimpkins/fontname.py](https://github.com/chrissimpkins/fontname.py) to complete this job.
For example:
```shell
git clone --depth 1 https://github.com/chrissimpkins/fontname.py.git
chmod +x ./fontname.py/fontname.py
./fontname.py/fontname.py "Agave iCursive Dk" /path/to/agave-r.ttf
./fontname.py/fontname.py "Agave iCursive Dk" /path/to/agave-b.ttf
./fontname.py/fontname.py "Agave iCursive Dk" /path/to/Dank\ Mono.ttf
```
You may be wondering why I use `S12`, `Op` and `Dk` as a suffix instead of something like `Script12`, `Operator` and `Dank`. This is because windows has a limit on the length of the font family, it cannot exceed 31 characters.
And now, you can use `fc-scan` command(in linux) to check the font family of a ttf file:
```shell
fc-scan -b /path/to/myfont.ttf
```
## The end
If you successfully patched the font, you can follow this [guide](https://wiki.archlinux.org/index.php/Fonts#Manual_installation) to install it.
In short:
```shell
cp /path/to/*.ttf ~/.local/share/fonts/
fc-cache
```
If you are very satisfied with the font you have patched, you can open a PR in this repository to share it with others.
For license reason, if you've patched a non-free font, it's not recommended to upload the binary files directly, but you can write a script to build it instead.

@ -1,118 +0,0 @@
**Archived. See this post instead: https://www.sainnhe.dev/post/patch-fonts-with-cursive-italic-styles/**
---
## Preview
For a preview of all available fonts, see [this wiki page](https://github.com/sainnhe/icursive-nerd-font/wiki/Preview).
## Introduction
Many vscode users use fonts like this with some themes that support italics, I want to do the same in vim. I've tried [FiraCodeiScript](https://github.com/kencrocken/FiraCodeiScript), [Operator Mono](https://www.typography.com/fonts/operator/styles) and [Dank Mono](https://dank.sh/) but their support for nerd font symbols is not very good.
Therefore, I decided to patch some fonts myself. All these fonts should support nerd font symbols and be suitable for use in TUI editors like vim.
Some fonts are free of charge, they are patched already and you can directly use the binary files. However, some fonts are not free, so you need to build them by yourself if you want to use them.
## Installation
1. Clone this repository.
2. If you want to install non-free fonts, you need to buy the fonts and build them by yourself.
3. For linux users, follow this [guide](https://wiki.archlinux.org/index.php/Fonts#Manual_installation) to install them.
In order to avoid copyright infringement, I cannot directly distribute the binary files of some fonts. However, if you encounter problems during the build process, [email me](mailto:sainnhe@gmail.com) and I will send you the font files that have been built.
For Arch Linux users, you can directly install all these fonts from [my repository](https://repo.sainnhe.dev/archlinux/). All these fonts are in a package group named `icursive-nerd-fonts`, so simply add this repository and install them via `pacman -S icursive-nerd-fonts`.
### Build
#### General Setup
There are some submodules in this repository, you'll need to update them at the very beginning.
```shell
$ git clone --depth 1 https://github.com/sainnhe/icursive-nerd-font.git
$ cd ./icursive-nerd-font
$ git submodule init
$ git submodule update
```
#### Op series
##### Requirements
1. Binary file of [Operator Mono](https://www.typography.com/fonts/operator/styles)
2. Node.js
3. Python (v2.7+)
4. Python 2 (or Python 3), `python-fontforge` package. See [Nerd Font Patcher](https://github.com/ryanoasis/nerd-fonts/#font-patcher) for details.
5. [`fonttools`](https://github.com/fonttools/fonttools) package. See [Operator Mono Ligatures](https://github.com/kiliman/operator-mono-lig#prerequisites) for details.
##### Step
`cd /path/to/icursive-nerd-font` and execute `./build.py Op /path/to/OperatorMono-BookItalic.otf`
E.g.:
```sh
./build.py Op ~/Downloads/Operator\ Mono/Operator\ Mono\ Book\ Italic.otf
```
The new font files will be placed in the `*Op` folders.
#### Dk series
##### Requirements
1. Binary file of [Dank Mono](https://dank.sh)
2. Python (v2.7+)
3. Python 2 (or Python 3), `python-fontforge` package. See [Nerd Font Patcher](https://github.com/ryanoasis/nerd-fonts/#font-patcher) for details.
##### Step
`cd /path/to/icursive-nerd-font` and execute `./build.py Dk /path/to/Dank\ Mono\ Italic.ttf`
E.g.:
```sh
./build.py Dk ~/Downloads/Dank\ Mono\ Italic.ttf
```
The new font files will be placed in the `*Dk` folders.
#### Cg series
##### Requirements
1. Binary file of [Cartograph](https://connary.com/cartograph.html)
2. Python (v2.7+)
3. Python 2 (or Python 3), `python-fontforge` package. See [Nerd Font Patcher](https://github.com/ryanoasis/nerd-fonts/#font-patcher) for details.
##### Step
`cd /path/to/icursive-nerd-font` and execute `./build.py Cg /path/to/Cartograph\ CF\ Italic.ttf`
E.g.:
```sh
./build.py Cg ~/Downloads/Cartograph\ Italic.ttf
```
The new font files will be placed in the `*Cg` folders.
## Contributing
See [PATCH.md](./PATCH.md) for more information.
## FAQ
**Q: What's the color scheme used here?**
**A:** [Gruvbox Material](https://github.com/sainnhe/gruvbox-material) using `mix` palette.
**Q: What's your status line configuration?**
**A:** See this [article](https://www.sainnhe.dev/post/status-line-config/).
## Inspiration
[kencrocken/FiraCodeiScript](https://github.com/kencrocken/FiraCodeiScript)

@ -1,388 +0,0 @@
#!/usr/bin/env python
"""
iCursive Nerd Font Patcher
"""
import os
import sys
from glob import glob
from platform import system
from shutil import copyfile, move
from subprocess import STDOUT, call
# {{{Initialization
RED = "\033[0;31m"
BRED = "\033[1;31m"
GREEN = "\033[0;32m"
BGREEN = "\033[1;32m"
YELLOW = "\033[0;33m"
BYELLOW = "\033[1;33m"
BLUE = "\033[0;34m"
BBLUE = "\033[1;34m"
NC = "\033[0m"
os.chdir(os.popen("git rev-parse --show-toplevel").read().rstrip("\n"))
# }}}
def general(style, font_path): # {{{
"""
general setup for all styles
"""
os.chdir(".cache")
if style == "Op": # {{{
copyfile(font_path, "./Operator Mono Book Italic.otf")
# patch ligatures
print("\n" + BYELLOW + "==>" + NC + " " + BGREEN +
"Patching ligatures..." + NC + "\n")
os.chdir("operator-mono-lig")
move("../Operator Mono Book Italic.otf",
"./original/OperatorMono-BookItalic.otf")
call(["npm", "install"])
if system() == "Windows":
os.system(os.path.abspath("build.bat"))
else:
call(["sh", "build.sh"])
copyfile("./build/OperatorMonoLig-BookItalic.otf",
"../Operator Mono Book Italic.otf")
os.chdir("..")
# patch nerd font symbols
print("\n" + BYELLOW + "==>" + NC + " " + BGREEN +
"Patching nerd font symbols..." + NC + "\n")
copyfile("Operator Mono Book Italic.otf",
"nerd-fonts/Operator Mono Book Italic.otf")
os.chdir("nerd-fonts")
call([
"python", "font-patcher", "--mono", "-w", "-c", "-ext", "ttf",
r"Operator Mono Book Italic.otf"
])
for file in glob("Operator*Windows Compatible.ttf"):
move(file, "../Operator Mono Book Italic.ttf")
os.remove("Operator Mono Book Italic.otf")
os.remove("../Operator Mono Book Italic.otf")
os.chdir(os.popen("git rev-parse --show-toplevel").read().rstrip("\n"))
# }}}
elif style == "Dk": # {{{
copyfile(font_path, "Dank Mono Italic.ttf")
# patch nerd font symbols
print("\n" + BYELLOW + "==>" + NC + " " + BGREEN +
"Patching nerd font symbols..." + NC + "\n")
move("Dank Mono Italic.ttf", "nerd-fonts/Dank Mono Italic.ttf")
os.chdir("nerd-fonts")
call([
"python", "font-patcher", "--mono", "-w", "-c", "-ext", "ttf",
r"Dank Mono Italic.ttf"
])
for file in glob("Dank*Windows Compatible.ttf"):
move(file, "../Dank Mono Italic.ttf")
os.remove("Dank Mono Italic.ttf")
os.chdir(os.popen("git rev-parse --show-toplevel").read().rstrip("\n"))
# }}}
elif style == "Cg": # {{{
copyfile(font_path, "Cartograph Italic.ttf")
# patch nerd font symbols
print("\n" + BYELLOW + "==>" + NC + " " + BGREEN +
"Patching nerd font symbols..." + NC + "\n")
move("Cartograph Italic.ttf", "nerd-fonts/Cartograph Italic.ttf")
os.chdir("nerd-fonts")
call([
"python", "font-patcher", "--mono", "-w", "-c", "-ext", "ttf",
r"Cartograph Italic.ttf"
])
for file in glob("*artograp*Windows Compatible.ttf"):
move(file, "../Cartograph Italic.ttf")
os.remove("Cartograph Italic.ttf")
os.chdir(os.popen("git rev-parse --show-toplevel").read().rstrip("\n"))
# }}}
# }}}
def build(style): # {{{
"""
build fonts
"""
dev_null = open(os.devnull, 'w')
if style == "Op": # {{{
# Fira Code iCursive Op
os.mkdir(os.path.join(os.getcwd(), "Fira Code iCursive Op"))
copyfile("Fira Code iCursive S12/Fira Code iCursive S12 Regular.ttf",
"Fira Code iCursive Op/Fira Code iCursive Op Regular.ttf")
copyfile("Fira Code iCursive S12/Fira Code iCursive S12 Bold.ttf",
"Fira Code iCursive Op/Fira Code iCursive Op Bold.ttf")
copyfile(".cache/Operator Mono Book Italic.ttf",
"Fira Code iCursive Op/Fira Code iCursive Op Italic.ttf")
call([
"python", ".cache/fontname.py/fontname.py",
r"Fira Code iCursive Op",
r"Fira Code iCursive Op/Fira Code iCursive Op Regular.ttf"
],
stdout=dev_null,
stderr=STDOUT)
call([
"python", ".cache/fontname.py/fontname.py",
r"Fira Code iCursive Op",
r"Fira Code iCursive Op/Fira Code iCursive Op Bold.ttf"
],
stdout=dev_null,
stderr=STDOUT)
call([
"python", ".cache/fontname.py/fontname.py",
r"Fira Code iCursive Op",
r"Fira Code iCursive Op/Fira Code iCursive Op Italic.ttf"
],
stdout=dev_null,
stderr=STDOUT)
# Source Code Pro iCursive Op
os.mkdir(os.path.join(os.getcwd(), "Source Code Pro iCursive Op"))
copyfile(
"Source Code Pro iCursive S12/" +
"Source Code Pro iCursive S12 Regular.ttf",
"Source Code Pro iCursive Op/" +
"Source Code Pro iCursive Op Regular.ttf")
copyfile(
"Source Code Pro iCursive S12/" +
"Source Code Pro iCursive S12 Bold.ttf",
"Source Code Pro iCursive Op/" +
"Source Code Pro iCursive Op Bold.ttf")
copyfile(
".cache/Operator Mono Book Italic.ttf",
"Source Code Pro iCursive Op/" +
"Source Code Pro iCursive Op Italic.ttf")
call([
"python", ".cache/fontname.py/fontname.py",
r"Source Code Pro iCursive Op", r"Source Code Pro iCursive Op/" +
r"Source Code Pro iCursive Op Regular.ttf"
],
stdout=dev_null,
stderr=STDOUT)
call([
"python", ".cache/fontname.py/fontname.py",
r"Source Code Pro iCursive Op", r"Source Code Pro iCursive Op/" +
r"Source Code Pro iCursive Op Bold.ttf"
],
stdout=dev_null,
stderr=STDOUT)
call([
"python", ".cache/fontname.py/fontname.py",
r"Source Code Pro iCursive Op", r"Source Code Pro iCursive Op/" +
r"Source Code Pro iCursive Op Italic.ttf"
],
stdout=dev_null,
stderr=STDOUT)
# InconsolataLGC iCursive Op
os.mkdir(os.path.join(os.getcwd(), "InconsolataLGC iCursive Op"))
copyfile(
"InconsolataLGC iCursive S12/" +
"InconsolataLGC iCursive S12 Regular.ttf",
"InconsolataLGC iCursive Op/InconsolataLGC iCursive Op Regular.ttf"
)
copyfile(
"InconsolataLGC iCursive S12/InconsolataLGC iCursive S12 Bold.ttf",
"InconsolataLGC iCursive Op/InconsolataLGC iCursive Op Bold.ttf")
copyfile(
".cache/Operator Mono Book Italic.ttf",
"InconsolataLGC iCursive Op/InconsolataLGC iCursive Op Italic.ttf")
call([
"python", ".cache/fontname.py/fontname.py",
r"InconsolataLGC iCursive Op", r"InconsolataLGC iCursive Op/" +
r"InconsolataLGC iCursive Op Regular.ttf"
],
stdout=dev_null,
stderr=STDOUT)
call([
"python", ".cache/fontname.py/fontname.py",
r"InconsolataLGC iCursive Op",
r"InconsolataLGC iCursive Op/InconsolataLGC iCursive Op Bold.ttf"
],
stdout=dev_null,
stderr=STDOUT)
call([
"python", ".cache/fontname.py/fontname.py",
r"InconsolataLGC iCursive Op",
r"InconsolataLGC iCursive Op/InconsolataLGC iCursive Op Italic.ttf"
],
stdout=dev_null,
stderr=STDOUT)
# Meslo iCursive Op
os.mkdir(os.path.join(os.getcwd(), "Meslo iCursive Op"))
copyfile("Meslo iCursive S12/Meslo iCursive S12 Regular.ttf",
"Meslo iCursive Op/Meslo iCursive Op Regular.ttf")
copyfile("Meslo iCursive S12/Meslo iCursive S12 Bold.ttf",
"Meslo iCursive Op/Meslo iCursive Op Bold.ttf")
copyfile(".cache/Operator Mono Book Italic.ttf",
"Meslo iCursive Op/Meslo iCursive Op Italic.ttf")
call([
"python", ".cache/fontname.py/fontname.py", r"Meslo iCursive Op",
r"Meslo iCursive Op/Meslo iCursive Op Regular.ttf"
],
stdout=dev_null,
stderr=STDOUT)
call([
"python", ".cache/fontname.py/fontname.py", r"Meslo iCursive Op",
r"Meslo iCursive Op/Meslo iCursive Op Bold.ttf"
],
stdout=dev_null,
stderr=STDOUT)
call([
"python", ".cache/fontname.py/fontname.py", r"Meslo iCursive Op",
r"Meslo iCursive Op/Meslo iCursive Op Italic.ttf"
],
stdout=dev_null,
stderr=STDOUT)
# Hack iCursive Op
os.mkdir(os.path.join(os.getcwd(), "Hack iCursive Op"))
copyfile("Hack iCursive S12/Hack iCursive S12 Regular.ttf",
"Hack iCursive Op/Hack iCursive Op Regular.ttf")
copyfile("Hack iCursive S12/Hack iCursive S12 Bold.ttf",
"Hack iCursive Op/Hack iCursive Op Bold.ttf")
copyfile(".cache/Operator Mono Book Italic.ttf",
"Hack iCursive Op/Hack iCursive Op Italic.ttf")
call([
"python", ".cache/fontname.py/fontname.py", r"Hack iCursive Op",
r"Hack iCursive Op/Hack iCursive Op Regular.ttf"
],
stdout=dev_null,
stderr=STDOUT)
call([
"python", ".cache/fontname.py/fontname.py", r"Hack iCursive Op",
r"Hack iCursive Op/Hack iCursive Op Bold.ttf"
],
stdout=dev_null,
stderr=STDOUT)
call([
"python", ".cache/fontname.py/fontname.py", r"Hack iCursive Op",
r"Hack iCursive Op/Hack iCursive Op Italic.ttf"
],
stdout=dev_null,
stderr=STDOUT)
# Fantasque iCursive Op
copyfile(".cache/Operator Mono Book Italic.ttf",
"Fantasque iCursive Op/Fantasque iCursive Op Italic.ttf")
call([
"python", ".cache/fontname.py/fontname.py",
r"Fantasque iCursive Op",
r"Fantasque iCursive Op/Fantasque iCursive Op Italic.ttf"
],
stdout=dev_null,
stderr=STDOUT)
# Lilex iCursive Op
os.mkdir(os.path.join(os.getcwd(), "Lilex iCursive Op"))
copyfile("Lilex iCursive S12/Lilex iCursive S12 Regular.ttf",
"Lilex iCursive Op/Lilex iCursive Op Regular.ttf")
copyfile("Lilex iCursive S12/Lilex iCursive S12 Medium.ttf",
"Lilex iCursive Op/Lilex iCursive Op Medium.ttf")
copyfile("Lilex iCursive S12/Lilex iCursive S12 Bold.ttf",
"Lilex iCursive Op/Lilex iCursive Op Bold.ttf")
copyfile(".cache/Operator Mono Book Italic.ttf",
"Lilex iCursive Op/Lilex iCursive Op Italic.ttf")
call([
"python", ".cache/fontname.py/fontname.py",
r"Lilex iCursive Op",
r"Lilex iCursive Op/Lilex iCursive Op Regular.ttf"
],
stdout=dev_null,
stderr=STDOUT)
call([
"python", ".cache/fontname.py/fontname.py",
r"Lilex iCursive Op",
r"Lilex iCursive Op/Lilex iCursive Op Medium.ttf"
],
stdout=dev_null,
stderr=STDOUT)
call([
"python", ".cache/fontname.py/fontname.py",
r"Lilex iCursive Op",
r"Lilex iCursive Op/Lilex iCursive Op Bold.ttf"
],
stdout=dev_null,
stderr=STDOUT)
call([
"python", ".cache/fontname.py/fontname.py",
r"Lilex iCursive Op",
r"Lilex iCursive Op/Lilex iCursive Op Italic.ttf"
],
stdout=dev_null,
stderr=STDOUT)
# }}}
elif style == "Dk": # {{{
# Fantasque iCursive Dk
copyfile(".cache/Dank Mono Italic.ttf",
"Fantasque iCursive Dk/Fantasque iCursive Dk Italic.ttf")
call([
"python", ".cache/fontname.py/fontname.py",
r"Fantasque iCursive Dk",
r"Fantasque iCursive Dk/Fantasque iCursive Dk Italic.ttf"
],
stdout=dev_null,
stderr=STDOUT)
# Lilex iCursive Dk
copyfile(".cache/Dank Mono Italic.ttf",
"Lilex iCursive Dk/Lilex iCursive Dk Italic.ttf")
call([
"python", ".cache/fontname.py/fontname.py",
r"Lilex iCursive Dk",
r"Lilex iCursive Dk/Lilex iCursive Dk Italic.ttf"
],
stdout=dev_null,
stderr=STDOUT)
# Cascadia Code iCursive Dk
copyfile(".cache/Dank Mono Italic.ttf",
"Cascadia Code iCursive Dk/Cascadia Code iCursive Dk Italic.ttf")
call([
"python", ".cache/fontname.py/fontname.py",
r"Cascadia Code iCursive Dk",
r"Cascadia Code iCursive Dk/Cascadia Code iCursive Dk Italic.ttf"
],
stdout=dev_null,
stderr=STDOUT)
# }}}
elif style == "Cg": # {{{
# Cascadia Code iCursive Cg
copyfile(
".cache/Cartograph Italic.ttf", "Cascadia Code iCursive Cg/" +
"Cascadia Code iCursive Cg Italic.ttf")
call([
"python", ".cache/fontname.py/fontname.py",
r"Cascadia Code iCursive Cg",
r"Cascadia Code iCursive Cg/Cascadia Code iCursive Cg Italic.ttf"
],
stdout=dev_null,
stderr=STDOUT)
# Recursive Code iCursive Cg
copyfile(
".cache/Cartograph Italic.ttf", "Recursive Code iCursive Cg/" +
"Recursive Code iCursive Cg Italic.ttf")
call([
"python", ".cache/fontname.py/fontname.py",
r"Recursive Code iCursive Cg",
r"Recursive Code iCursive Cg/Recursive Code iCursive Cg Italic.ttf"
],
stdout=dev_null,
stderr=STDOUT)
# }}}
# }}}
if len(sys.argv) != 3:
print("\n" + BYELLOW + "==>" + NC + " " + BRED + "Invalid arguments." +
NC + "\n")
sys.exit(1)
elif sys.argv[1] != "Op" and sys.argv[1] != "Dk" and sys.argv[1] != "Cg":
print("\n" + BYELLOW + "==>" + NC + " " + BRED + "Invalid arguments." +
NC + "\n")
sys.exit(1)
elif not os.path.isfile(sys.argv[2]):
print("\n" + BYELLOW + "==>" + NC + " " + BRED + "File not accessible." +
NC + "\n")
sys.exit(1)
else:
general(sys.argv[1], sys.argv[2])
build(sys.argv[1])
print("\n" + BYELLOW + "==>" + NC + " " + BBLUE + "Cache directory:" + NC +
GREEN + os.path.join(os.getcwd(), ".cache") + "\n")
CLEAN = input(BYELLOW + "==>" + NC + " " + BBLUE + "Clean cache? [Y/n] ")
if CLEAN in ("", "Y", "y"):
print(BYELLOW + "==>" + NC + " " + BGREEN +
"git clean -fdx -- .cache" + NC + "\n")
call(["git", "clean", "-d", "-f", "-x", "--", ".cache"])
print("\n" + BYELLOW + "==>" + NC + " " + BGREEN +
"Done." + NC + "\n")

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,31 @@
char_dict = {
'ampersand': '&',
'asciicircum': '^',
'asciitilde': '~',
'asterisk': '*',
'backslash': '\\',
'bar': '|',
'colon': ':',
'equal': '=',
'exclam': '!',
'greater': '>',
'hyphen': '-',
'less': '<',
'numbersign': '#',
'percent': '%',
'period': '.',
'plus': '+',
'question': '?',
'semicolon': ';',
'slash': '/',
'underscore': '_',
'at': '@',
'braceleft': '{',
'braceright': '}',
'bracketleft': '[',
'bracketright': ']',
'dollar': '$',
'parenleft': '(',
'parenright': ')',
'w': 'w',
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,606 @@
## This is the master list of ligatures that ligaturize.py will attempt to copy
## from Fira Code to your output font. Ligatures that aren't present in the
## version of Fira Code you're using will be skipped.
## To disable ligatures, simply comment them out in this file.
ligatures = [
{
## These are all the punctuation characters used in Fira Code ligatures.
## Use the `--copy-character-glyphs` option to copy these into the output
## font along with the ligatures themselves.
'chars': [
## These characters generally look good in most fonts and are
## enabled by default if you use `--copy-character-glyphs`.
'ampersand', 'asciicircum', 'asciitilde', 'asterisk',
'backslash', 'bar',
'colon', 'equal', 'exclam', 'greater', 'hyphen',
'less', 'numbersign', 'percent', 'period', 'plus',
'question', 'semicolon', 'slash', 'underscore',
## These characters are also used by the ligatures, but are likely
## to look more out of place when spliced into another font.
# 'at', 'braceleft', 'braceright', 'bracketleft', 'bracketright',
# 'dollar', 'parenleft', 'parenright', 'underscore', 'w'
],
'firacode_ligature_name': None,
},
## These are traditional (i.e. present in most variable-width fonts)
## aesthetic ligatures. They are commented out here so that they don't
## overwrite similar ligatures present in the destination font.
# { # Fl
# 'chars': ['F', 'l'],
# 'firacode_ligature_name': 'F_l.liga',
# },
# { # Tl
# 'chars': ['T', 'l'],
# 'firacode_ligature_name': 'T_l.liga',
# },
# { # fi
# 'chars': ['f', 'i'],
# 'firacode_ligature_name': 'f_i.liga',
# },
# { # fj
# 'chars': ['f', 'j'],
# 'firacode_ligature_name': 'f_j.liga',
# },
# { # fl
# 'chars': ['f', 'l'],
# 'firacode_ligature_name': 'f_l.liga',
# },
# { # ft
# 'chars': ['f', 't'],
# 'firacode_ligature_name': 'f_t.liga',
# },
## Programming ligatures begin here.
{ # &&
'chars': ['ampersand', 'ampersand'],
'firacode_ligature_name': 'ampersand_ampersand.liga',
},
{ # ^=
'chars': ['asciicircum', 'equal'],
'firacode_ligature_name': 'asciicircum_equal.liga',
},
{ # ~~
'chars': ['asciitilde', 'asciitilde'],
'firacode_ligature_name': 'asciitilde_asciitilde.liga',
},
{ # ~~>
'chars': ['asciitilde', 'asciitilde', 'greater'],
'firacode_ligature_name': 'asciitilde_asciitilde_greater.liga',
},
{ # ~@
'chars': ['asciitilde', 'at'],
'firacode_ligature_name': 'asciitilde_at.liga',
},
{ # ~=
'chars': ['asciitilde', 'equal'],
'firacode_ligature_name': 'asciitilde_equal.liga',
},
{ # ~>
'chars': ['asciitilde', 'greater'],
'firacode_ligature_name': 'asciitilde_greater.liga',
},
{ # ~-
'chars': ['asciitilde', 'hyphen'],
'firacode_ligature_name': 'asciitilde_hyphen.liga',
},
{ # **
'chars': ['asterisk', 'asterisk'],
'firacode_ligature_name': 'asterisk_asterisk.liga',
},
{ # ***
'chars': ['asterisk', 'asterisk', 'asterisk'],
'firacode_ligature_name': 'asterisk_asterisk_asterisk.liga',
},
{ # *>
'chars': ['asterisk', 'greater'],
'firacode_ligature_name': 'asterisk_greater.liga',
},
{ # */
'chars': ['asterisk', 'slash'],
'firacode_ligature_name': 'asterisk_slash.liga',
},
{ # \/
'chars': ['backslash', 'slash'],
'firacode_ligature_name': 'backslash_slash.liga',
},
{ # ||
'chars': ['bar', 'bar'],
'firacode_ligature_name': 'bar_bar.liga',
},
{ # |||>
'chars': ['bar', 'bar', 'bar', 'greater'],
'firacode_ligature_name': 'bar_bar_bar_greater.liga',
},
{ # ||=
'chars': ['bar', 'bar', 'equal'],
'firacode_ligature_name': 'bar_bar_equal.liga',
},
{ # ||>
'chars': ['bar', 'bar', 'greater'],
'firacode_ligature_name': 'bar_bar_greater.liga',
},
{ # ||-
'chars': ['bar', 'bar', 'hyphen'],
'firacode_ligature_name': 'bar_bar_hyphen.liga',
},
{ # |}
'chars': ['bar', 'braceright'],
'firacode_ligature_name': 'bar_braceright.liga',
},
{ # |]
'chars': ['bar', 'bracketright'],
'firacode_ligature_name': 'bar_bracketright.liga',
},
{ # |=
'chars': ['bar', 'equal'],
'firacode_ligature_name': 'bar_equal.liga',
},
{ # |=>
'chars': ['bar', 'equal', 'greater'],
'firacode_ligature_name': 'bar_equal_greater.liga',
},
{ # |>
'chars': ['bar', 'greater'],
'firacode_ligature_name': 'bar_greater.liga',
},
{ # |-
'chars': ['bar', 'hyphen'],
'firacode_ligature_name': 'bar_hyphen.liga',
},
{ # |->
'chars': ['bar', 'hyphen', 'greater'],
'firacode_ligature_name': 'bar_hyphen_greater.liga',
},
{ # {|
'chars': ['braceleft', 'bar'],
'firacode_ligature_name': 'braceleft_bar.liga',
},
{ # [|
'chars': ['bracketleft', 'bar'],
'firacode_ligature_name': 'bracketleft_bar.liga',
},
{ # ]#
'chars': ['bracketright', 'numbersign'],
'firacode_ligature_name': 'bracketright_numbersign.liga',
},
{ # ::
'chars': ['colon', 'colon'],
'firacode_ligature_name': 'colon_colon.liga',
},
{ # :::
'chars': ['colon', 'colon', 'colon'],
'firacode_ligature_name': 'colon_colon_colon.liga',
},
{ # ::=
'chars': ['colon', 'colon', 'equal'],
'firacode_ligature_name': 'colon_colon_equal.liga',
},
{ # :=
'chars': ['colon', 'equal'],
'firacode_ligature_name': 'colon_equal.liga',
},
{ # :>
'chars': ['colon', 'greater'],
'firacode_ligature_name': 'colon_greater.liga',
},
{ # :<
'chars': ['colon', 'less'],
'firacode_ligature_name': 'colon_less.liga',
},
{ # $>
'chars': ['dollar', 'greater'],
'firacode_ligature_name': 'dollar_greater.liga',
},
{ # =:=
'chars': ['equal', 'colon', 'equal'],
'firacode_ligature_name': 'equal_colon_equal.liga',
},
{ # ==
'chars': ['equal', 'equal'],
'firacode_ligature_name': 'equal_equal.liga',
},
{ # ===
'chars': ['equal', 'equal', 'equal'],
'firacode_ligature_name': 'equal_equal_equal.liga',
},
{ # ==>
'chars': ['equal', 'equal', 'greater'],
'firacode_ligature_name': 'equal_equal_greater.liga',
},
{ # =!=
'chars': ['equal', 'exclam', 'equal'],
'firacode_ligature_name': 'equal_exclam_equal.liga',
},
{ # =>
'chars': ['equal', 'greater'],
'firacode_ligature_name': 'equal_greater.liga',
},
{ # =>>
'chars': ['equal', 'greater', 'greater'],
'firacode_ligature_name': 'equal_greater_greater.liga',
},
{ # =<<
'chars': ['equal', 'less', 'less'],
'firacode_ligature_name': 'equal_less_less.liga',
},
{ # =/=
'chars': ['equal', 'slash', 'equal'],
'firacode_ligature_name': 'equal_slash_equal.liga',
},
{ # !=
'chars': ['exclam', 'equal'],
'firacode_ligature_name': 'exclam_equal.liga',
},
{ # !==
'chars': ['exclam', 'equal', 'equal'],
'firacode_ligature_name': 'exclam_equal_equal.liga',
},
{ # !!
'chars': ['exclam', 'exclam'],
'firacode_ligature_name': 'exclam_exclam.liga',
},
{ # !!.
'chars': ['exclam', 'exclam', 'period'],
'firacode_ligature_name': 'exclam_exclam_period.liga',
},
{ # >:
'chars': ['greater', 'colon'],
'firacode_ligature_name': 'greater_colon.liga',
},
{ # >=
'chars': ['greater', 'equal'],
'firacode_ligature_name': 'greater_equal.liga',
},
{ # >=>
'chars': ['greater', 'equal', 'greater'],
'firacode_ligature_name': 'greater_equal_greater.liga',
},
{ # >>
'chars': ['greater', 'greater'],
'firacode_ligature_name': 'greater_greater.liga',
},
{ # >>=
'chars': ['greater', 'greater', 'equal'],
'firacode_ligature_name': 'greater_greater_equal.liga',
},
{ # >>>
'chars': ['greater', 'greater', 'greater'],
'firacode_ligature_name': 'greater_greater_greater.liga',
},
{ # >>-
'chars': ['greater', 'greater', 'hyphen'],
'firacode_ligature_name': 'greater_greater_hyphen.liga',
},
{ # >-
'chars': ['greater', 'hyphen'],
'firacode_ligature_name': 'greater_hyphen.liga',
},
{ # >->
'chars': ['greater', 'hyphen', 'greater'],
'firacode_ligature_name': 'greater_hyphen_greater.liga',
},
{ # -~
'chars': ['hyphen', 'asciitilde'],
'firacode_ligature_name': 'hyphen_asciitilde.liga',
},
{ # -|
'chars': ['hyphen', 'bar'],
'firacode_ligature_name': 'hyphen_bar.liga',
},
{ # ->
'chars': ['hyphen', 'greater'],
'firacode_ligature_name': 'hyphen_greater.liga',
},
{ # ->>
'chars': ['hyphen', 'greater', 'greater'],
'firacode_ligature_name': 'hyphen_greater_greater.liga',
},
{ # --
'chars': ['hyphen', 'hyphen'],
'firacode_ligature_name': 'hyphen_hyphen.liga',
},
{ # -->
'chars': ['hyphen', 'hyphen', 'greater'],
'firacode_ligature_name': 'hyphen_hyphen_greater.liga',
},
{ # ---
'chars': ['hyphen', 'hyphen', 'hyphen'],
'firacode_ligature_name': 'hyphen_hyphen_hyphen.liga',
},
{ # -<
'chars': ['hyphen', 'less'],
'firacode_ligature_name': 'hyphen_less.liga',
},
{ # -<<
'chars': ['hyphen', 'less', 'less'],
'firacode_ligature_name': 'hyphen_less_less.liga',
},
{ # <~
'chars': ['less', 'asciitilde'],
'firacode_ligature_name': 'less_asciitilde.liga',
},
{ # <~~
'chars': ['less', 'asciitilde', 'asciitilde'],
'firacode_ligature_name': 'less_asciitilde_asciitilde.liga',
},
{ # <~>
'chars': ['less', 'asciitilde', 'greater'],
'firacode_ligature_name': 'less_asciitilde_greater.liga',
},
{ # <*
'chars': ['less', 'asterisk'],
'firacode_ligature_name': 'less_asterisk.liga',
},
{ # <*>
'chars': ['less', 'asterisk', 'greater'],
'firacode_ligature_name': 'less_asterisk_greater.liga',
},
{ # <|
'chars': ['less', 'bar'],
'firacode_ligature_name': 'less_bar.liga',
},
{ # <||
'chars': ['less', 'bar', 'bar'],
'firacode_ligature_name': 'less_bar_bar.liga',
},
{ # <|||
'chars': ['less', 'bar', 'bar', 'bar'],
'firacode_ligature_name': 'less_bar_bar_bar.liga',
},
{ # <|>
'chars': ['less', 'bar', 'greater'],
'firacode_ligature_name': 'less_bar_greater.liga',
},
{ # <:
'chars': ['less', 'colon'],
'firacode_ligature_name': 'less_colon.liga',
},
{ # <$
'chars': ['less', 'dollar'],
'firacode_ligature_name': 'less_dollar.liga',
},
{ # <$>
'chars': ['less', 'dollar', 'greater'],
'firacode_ligature_name': 'less_dollar_greater.liga',
},
{ # <=
'chars': ['less', 'equal'],
'firacode_ligature_name': 'less_equal.liga',
},
{ # <=|
'chars': ['less', 'equal', 'bar'],
'firacode_ligature_name': 'less_equal_bar.liga',
},
{ # <==
'chars': ['less', 'equal', 'equal'],
'firacode_ligature_name': 'less_equal_equal.liga',
},
{ # <==>
'chars': ['less', 'equal', 'equal', 'greater'],
'firacode_ligature_name': 'less_equal_equal_greater.liga',
},
{ # <=>
'chars': ['less', 'equal', 'greater'],
'firacode_ligature_name': 'less_equal_greater.liga',
},
{ # <=<
'chars': ['less', 'equal', 'less'],
'firacode_ligature_name': 'less_equal_less.liga',
},
{ # <!--
'chars': ['less', 'exclam', 'hyphen', 'hyphen'],
'firacode_ligature_name': 'less_exclam_hyphen_hyphen.liga',
},
{ # <>
'chars': ['less', 'greater'],
'firacode_ligature_name': 'less_greater.liga',
},
{ # <-
'chars': ['less', 'hyphen'],
'firacode_ligature_name': 'less_hyphen.liga',
},
{ # <-|
'chars': ['less', 'hyphen', 'bar'],
'firacode_ligature_name': 'less_hyphen_bar.liga',
},
{ # <->
'chars': ['less', 'hyphen', 'greater'],
'firacode_ligature_name': 'less_hyphen_greater.liga',
},
{ # <--
'chars': ['less', 'hyphen', 'hyphen'],
'firacode_ligature_name': 'less_hyphen_hyphen.liga',
},
{ # <-<
'chars': ['less', 'hyphen', 'less'],
'firacode_ligature_name': 'less_hyphen_less.liga',
},
{ # <<
'chars': ['less', 'less'],
'firacode_ligature_name': 'less_less.liga',
},
{ # <<=
'chars': ['less', 'less', 'equal'],
'firacode_ligature_name': 'less_less_equal.liga',
},
{ # <<-
'chars': ['less', 'less', 'hyphen'],
'firacode_ligature_name': 'less_less_hyphen.liga',
},
{ # <<->>
'chars': ['less', 'less', 'hyphen', 'greater', 'greater'],
'firacode_ligature_name': 'less_less_hyphen_greater_greater.liga',
},
{ # <<<
'chars': ['less', 'less', 'less'],
'firacode_ligature_name': 'less_less_less.liga',
},
{ # <+
'chars': ['less', 'plus'],
'firacode_ligature_name': 'less_plus.liga',
},
{ # <+>
'chars': ['less', 'plus', 'greater'],
'firacode_ligature_name': 'less_plus_greater.liga',
},
{ # </
'chars': ['less', 'slash'],
'firacode_ligature_name': 'less_slash.liga',
},
{ # </>
'chars': ['less', 'slash', 'greater'],
'firacode_ligature_name': 'less_slash_greater.liga',
},
{ # #{
'chars': ['numbersign', 'braceleft'],
'firacode_ligature_name': 'numbersign_braceleft.liga',
},
{ # #[
'chars': ['numbersign', 'bracketleft'],
'firacode_ligature_name': 'numbersign_bracketleft.liga',
},
{ # #:
'chars': ['numbersign', 'colon'],
'firacode_ligature_name': 'numbersign_colon.liga',
},
{ # #=
'chars': ['numbersign', 'equal'],
'firacode_ligature_name': 'numbersign_equal.liga',
},
{ # #!
'chars': ['numbersign', 'exclam'],
'firacode_ligature_name': 'numbersign_exclam.liga',
},
{ # ##
'chars': ['numbersign', 'numbersign'],
'firacode_ligature_name': 'numbersign_numbersign.liga',
},
{ # ###
'chars': ['numbersign', 'numbersign', 'numbersign'],
'firacode_ligature_name': 'numbersign_numbersign_numbersign.liga',
},
{ # ####
'chars': ['numbersign', 'numbersign', 'numbersign', 'numbersign'],
'firacode_ligature_name': 'numbersign_numbersign_numbersign_numbersign.liga',
},
{ # #(
'chars': ['numbersign', 'parenleft'],
'firacode_ligature_name': 'numbersign_parenleft.liga',
},
{ # #?
'chars': ['numbersign', 'question'],
'firacode_ligature_name': 'numbersign_question.liga',
},
{ # #_
'chars': ['numbersign', 'underscore'],
'firacode_ligature_name': 'numbersign_underscore.liga',
},
{ # #_(
'chars': ['numbersign', 'underscore', 'parenleft'],
'firacode_ligature_name': 'numbersign_underscore_parenleft.liga',
},
{ # %%
'chars': ['percent', 'percent'],
'firacode_ligature_name': 'percent_percent.liga',
},
{ # .=
'chars': ['period', 'equal'],
'firacode_ligature_name': 'period_equal.liga',
},
{ # .-
'chars': ['period', 'hyphen'],
'firacode_ligature_name': 'period_hyphen.liga',
},
{ # ..
'chars': ['period', 'period'],
'firacode_ligature_name': 'period_period.liga',
},
{ # ..=
'chars': ['period', 'period', 'equal'],
'firacode_ligature_name': 'period_period_equal.liga',
},
{ # ..<
'chars': ['period', 'period', 'less'],