mirror of
https://github.com/daylinmorgan/monolisa-nerdfont-patch.git
synced 2024-12-22 23:10:44 -06:00
Compare commits
3 commits
d3df25bc75
...
5a6113df5f
Author | SHA1 | Date | |
---|---|---|---|
5a6113df5f | |||
36ad6b5009 | |||
73e8520c8e |
3 changed files with 44 additions and 2 deletions
16
Makefile
16
Makefile
|
@ -1,7 +1,12 @@
|
||||||
ARGS ?= -c
|
ARGS ?= -c
|
||||||
OK_TYPES := otf ttf woff woff2
|
OK_TYPES := otf ttf woff woff2
|
||||||
NF_SRC := $(shell find src -type f)
|
NF_SRC := $(shell find src -type f)
|
||||||
ML_TYPES := $(shell find MonoLisa -mindepth 1 -type d -printf "%f ")
|
ML_TYPES := $(shell find ./MonoLisa \
|
||||||
|
-mindepth 1 \
|
||||||
|
-maxdepth 1 \
|
||||||
|
-not -empty \
|
||||||
|
-type d \
|
||||||
|
-exec basename {} \;)
|
||||||
|
|
||||||
UNKNOWN := $(filter-out $(OK_TYPES),$(ML_TYPES))
|
UNKNOWN := $(filter-out $(OK_TYPES),$(ML_TYPES))
|
||||||
$(if $(UNKNOWN),$(error unknown font type in ./MonoLisa: $(UNKNOWN)))
|
$(if $(UNKNOWN),$(error unknown font type in ./MonoLisa: $(UNKNOWN)))
|
||||||
|
@ -9,13 +14,22 @@ $(if $(UNKNOWN),$(error unknown font type in ./MonoLisa: $(UNKNOWN)))
|
||||||
msg = $(call tprint,{a.bold}==>{a.end} {a.b_magenta}$(1){a.end} {a.bold}<=={a.end})
|
msg = $(call tprint,{a.bold}==>{a.end} {a.b_magenta}$(1){a.end} {a.bold}<=={a.end})
|
||||||
|
|
||||||
## patch | add nerd fonts to MonoLisa
|
## patch | add nerd fonts to MonoLisa
|
||||||
|
ifdef DOCKER
|
||||||
|
.PHONY: patch
|
||||||
|
patch: $(foreach ml-type,$(ML_TYPES),patch-$(ml-type)-docker)
|
||||||
|
else
|
||||||
.PHONY: patch
|
.PHONY: patch
|
||||||
patch: $(addprefix patch-,$(ML_TYPES))
|
patch: $(addprefix patch-,$(ML_TYPES))
|
||||||
|
endif
|
||||||
|
|
||||||
patch-%: ./bin/font-patcher
|
patch-%: ./bin/font-patcher
|
||||||
$(call msg, Patching MonoLisa $* Files)
|
$(call msg, Patching MonoLisa $* Files)
|
||||||
@./bin/patch-monolisa $* $(ARGS)
|
@./bin/patch-monolisa $* $(ARGS)
|
||||||
|
|
||||||
|
patch-%-docker: ./bin/font-patcher
|
||||||
|
$(call msg, Patching Monolisa $* Files w/Docker)
|
||||||
|
@./bin/patch-monolisa-docker $* $(ARGS)
|
||||||
|
|
||||||
## update-fonts | move fonts and update fc-cache
|
## update-fonts | move fonts and update fc-cache
|
||||||
.PHONY: update-fonts
|
.PHONY: update-fonts
|
||||||
update-fonts:
|
update-fonts:
|
||||||
|
|
|
@ -22,6 +22,8 @@ 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).
|
You can also download the version for your system from the releases in the fontforge [repo](https://github.com/fontforge/fontforge).
|
||||||
|
|
||||||
|
If you prefer to use `docker` rather than install `fontforge` you can just add `DOCKER=1` to calls to `make patch`.
|
||||||
|
|
||||||
## Downloading MonoLisa
|
## Downloading MonoLisa
|
||||||
|
|
||||||
Once you have acquired MonoLisa, follow the link in your email to download it.
|
Once you have acquired MonoLisa, follow the link in your email to download it.
|
||||||
|
@ -45,7 +47,6 @@ you can easily apply the nerd font patches with `make`.
|
||||||
|
|
||||||
To patch all font types use the default `patch` rule.
|
To patch all font types use the default `patch` rule.
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
make
|
make
|
||||||
```
|
```
|
||||||
|
|
27
bin/patch-monolisa-docker
Executable file
27
bin/patch-monolisa-docker
Executable file
|
@ -0,0 +1,27 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# set -e
|
||||||
|
# docker exits with code 1?
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
|
docker run --rm -v "$(pwd)/MonoLisa/$ext:/in" -v "$(pwd)/patched/$ext:/out" nerdfonts/patcher $fp_args
|
||||||
|
|
||||||
|
exit 0
|
Loading…
Reference in a new issue