generated from pa-0/NerdFontPatcherRepo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdo_generate
executable file
·37 lines (29 loc) · 1.1 KB
/
do_generate
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
#!/usr/bin/env sh
#
# Create and rename one font style according to the specs
# Example invocation:
# do_generate 01 --powerline --mono CascadiaCodePL-Regular.ttf DelugiaPowerline.ttf Delugia Regular PL-Mono
#
# No parameters are checked, but they are:
# 1: Number of logfile
# 2: Conversion spec #1
# 3: Conversion spec #2
# 4: Input font file name
# 5: Output font file name
# 6: Font family (and base name)
set -e
if [ "$#" -ne 6 ]; then
exit 1
fi
PWD=$( pwd )
outdir="${6}"
if [ ! -d "$outdir" ]; then
mkdir "$outdir"
fi
# rm -f C*.ttf >>> remnant from delugia-font repo
fontforge -script "${PWD}/font-patcher" --debug 2 --careful "${3}" --custom SomeExtraSymbols.sfd --has-no-italic "${PWD}/${4}" "${2}" --outputdir "${PWD}/$outdir" --makegroups 4 --name "${5}" | tee "process${1}.log"
if [ -z "${OURVERSION}" ]; then
# Github CI sets this variable, but this can be useful for manual calls:
OURVERSION=`git describe --always --tags`
fi
# fontforge -script "${PWD}/rename-font" --orig "${PWD}/${4}" --input "${PWD}/${6}"* --output "${PWD}/$outdir/${5}.ttf" --version "${OURVERSION}" --name "${6}"