monolisa-nerdfont-patch/README.md

108 lines
2.7 KiB
Markdown
Raw Normal View History

2021-11-09 10:28:41 -06:00
# MonoLisa NF
2021-11-09 12:02:47 -06:00
2022-12-07 16:12:24 -06:00
_Most_ Batteries included repo to patch MonoLisa with Nerd Fonts glyphs
2021-11-09 12:02:47 -06:00
2023-01-03 11:50:33 -06:00
tested w/ MonoLisa v2.003
2022-08-12 13:37:15 -05:00
2022-09-05 18:40:52 -05:00
<p align="center">
<img src="./assets/help.svg" width=400>
</p>
## Getting Started
### Dependencies
2021-11-09 12:02:47 -06:00
2023-01-03 11:50:33 -06:00
- `python`
- `make` (optional)
2023-01-03 11:50:33 -06:00
- `fontforge` OR `docker`
There are some caveats to invoking the `font-patcher` script.
2021-11-09 12:02:47 -06:00
Some of which are explained by [nerd fonts](https://github.com/ryanoasis/nerd-fonts#font-patcher).
2023-01-03 11:50:33 -06:00
To use `font-patcher` with `fontforge` first ensure it is installed (or see below for `docker` approach).
2021-11-09 12:02:47 -06:00
2022-08-12 13:37:15 -05:00
On Arch:
```bash
sudo pacman -S fontforge
```
You can also download the version for your system from the releases in the fontforge [repo](https://github.com/fontforge/fontforge).
2021-11-09 12:02:47 -06:00
2022-12-07 16:12:24 -06:00
If you prefer to use `docker` rather than install `fontforge` you can add `ARGS='--docker'` to calls to `make patch`.
2022-12-01 14:16:40 -06:00
Next you may clone the repo to fetch the needed symbols/scripts for patching:
```bash
git clone --depth 1 git@github.com:daylinmorgan/monolisa-nerdfont-patch.git
```
2021-11-09 12:02:47 -06:00
## Downloading MonoLisa
Once you have acquired MonoLisa, follow the link in your email to download it.
2022-08-12 13:37:15 -05:00
Then extract the `.zip` file of the type you've downloaded into `MonoLisa/`.
The expected directory structure is below.
You only need to download the font types you plan to use.
```bash
MonoLisa
├── otf
├── ttf
├── woff
└── woff2
```
2021-11-09 12:02:47 -06:00
## Patching your font
Once you have downloaded MonoLisa and `fontforge`
2022-08-12 13:37:15 -05:00
you can easily apply the nerd font patches with `make`.
To patch all font types use the default `patch` rule.
```bash
make # or ./patch-monolisa -f MonoLisa -c
2022-08-12 13:37:15 -05:00
```
By default the complete (`-c`) flag is passed to the font-patcher script to include all icons/symbols.
You can change this by specifying the `ARGS` at runtime.
2021-11-09 12:02:47 -06:00
```bash
2022-08-12 13:37:15 -05:00
ARGS="-c -w" make patch
2021-11-09 13:22:57 -06:00
```
See `./patch-monolisa --help` and `./bin/font-patcher --help` for available `ARGS`.
2022-12-07 16:12:24 -06:00
2021-11-09 13:22:57 -06:00
You can find your patched fonts in the `patched/` directory
2022-08-12 13:37:15 -05:00
If like me you want to place your patched fonts in a standard location on your Unix system you can move them to `~/.local/share/fonts/MonoLisa` with the `bin/update-fonts` script.
Or for simplicity you can copy the fonts and update the cache with:
2022-12-07 16:12:24 -06:00
2022-08-12 13:37:15 -05:00
```bash
make update-fonts
```
You can verify the fonts have been added with `make check`.
2022-03-02 13:35:36 -06:00
2024-01-30 20:33:49 -06:00
## with Nix
You can run using the included `flake.nix`.
```bash
nix run "github:daylinmorgan/monolisa-nerdfont-patch"
```
2023-01-07 10:12:48 -06:00
## Contributing
Before making changes to to any of the scripts in `bin` you should first install `pre-commit`.
Followed by setting up the `pre-commit` hooks locally.
```bash
pipx install pre-commit
pre-commit install
```
2021-11-09 13:22:57 -06:00
## Special Thanks
2022-03-02 13:35:36 -06:00
- [MonoLisa](https://www.monolisa.dev)
- [Nerd Fonts](https://www.nerdfonts.com)