From fed632bb916369770f0953678eb6208c3e7e7419 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Tue, 9 Nov 2021 12:02:47 -0600 Subject: [PATCH] update README and add patch-monolisa --- README.md | 27 +++++++++++++++++++++++++++ patch-monolisa | 30 ++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100755 patch-monolisa diff --git a/README.md b/README.md index 45a8e0d..3f21423 100644 --- a/README.md +++ b/README.md @@ -1 +1,28 @@ # MonoLisa NF + +Batteries inlcuded repo to patch MonoLisa with Nerd Fonts glyphs + +## Before You Begin + +First you will need to install `fontforge` +There are a number of caveats to invoking the `font-patcher` script. +Some of which are explained by [nerd fonts](https://github.com/ryanoasis/nerd-fonts#font-patcher). + +Using `patch-monolisa` assumes you have installed fontforge using your system dependency manager. +On ubuntu: `sudo apt-get install fontforge`. + +## Downloading MonoLisa + +Once you have acquired MonoLisa, follow the link in your email to download it. +Then extract the `.zip` into `MonoLisa/`. + +## Patching your font + +Once you have downloaded MonoLisa and `fontforge` +you can easily apply the nerd font patches using the `patch-monolisa` script. +The only required argument is the font file extension you want to patch. +All remiaining supplied arguments are passed to the `font-patcher` script. + +```bash +./patch-monolisa otf -c -w +``` \ No newline at end of file diff --git a/patch-monolisa b/patch-monolisa new file mode 100755 index 0000000..1bbd5e3 --- /dev/null +++ b/patch-monolisa @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + + +exts=(otf ttf woff woff2) +ext=$1 +shift +fp_args=$@ + +if [[ -z "$ext" ]];then + echo "please provide an extension" + exit 1 +fi + +if [[ ! " ${exts[@]} " =~ " ${ext} " ]]; then + echo "$ext is not a valid extension" + echo "Please choose one of the below:" + printf '%s\n' "${exts[@]}" + exit 1 +fi + +echo "Patching all fonts with ext -> $ext" +echo "Using the following arguments for font-patcher $fp_args" + + +for fontfile in MonoLisa/$ext/*.$ext; do + + fontforge -script font-patcher $fontfile -o patched/$ext $fp_args + +done +