-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathupdate-example-output.sh
executable file
·79 lines (65 loc) · 2.21 KB
/
update-example-output.sh
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
#
#
# Update the example-output directory using Metapolator and
# MutatorMath to generate instances at 50% between Light and ExtraBold
# for the Khula font.
#
#
#
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ "y$(pwd)" != "y$SCRIPTDIR" ]; then
echo "You must run this script from the base directory of the repository."
echo "Please run it as ./update-example-output.sh"
exit 1
fi
#
#
#####################################
#####################################
#####################################
#
# Generate output using Metapolator
#
#
rm -rf "$SCRIPTDIR/example-output/metapolator-Khula-090x-456.ufo"
rm -rf "$SCRIPTDIR/example-output/metapolator-Khula.ufo"
echo "Performing metapolation on 3 devanagari glyphs"
./metapolator-interpolate.js \
-a Khula-Light-090x-456.ufo \
-b Khula-ExtraBold-090x-456.ufo \
-o "$SCRIPTDIR/example-output/metapolator-Khula-090x-456.ufo"
echo "Performing metapolation on full Khila font"
./metapolator-interpolate.js \
-a Khula-Light.ufo \
-b Khula-ExtraBold.ufo \
-o "$SCRIPTDIR/example-output/metapolator-Khula.ufo"
#
#
#####################################
#####################################
#####################################
#
# Generate output using MutatorMath
#
#
# patch the nasty output so that FontForge knows the size
ensureFontForgeFriendlyFontInfo() {
ufopath=$1
echo "patching $ufopath/fontinfo.plist"
sed -i "s|<string>styleName</string>|<string>styleName</string><key>unitsPerEm</key><integer>2048</integer>|g" $ufopath/fontinfo.plist
}
rm -rf "$SCRIPTDIR/example-output/mutatormath-Khula-090x-456.ufo"
rm -rf "$SCRIPTDIR/example-output/mutatormath-Khula.ufo"
./simpleblend.py \
`pwd`/fonts/Khula-Light-090x-456.ufo \
`pwd`/fonts/Khula-ExtraBold-090x-456.ufo \
weight 0.5 \
"$SCRIPTDIR/example-output/mutatormath-Khula-090x-456.ufo"
./simpleblend.py \
`pwd`/fonts/Khula-Light.ufo \
`pwd`/fonts/Khula-ExtraBold.ufo \
weight 0.5 \
"$SCRIPTDIR/example-output/mutatormath-Khula.ufo"
ensureFontForgeFriendlyFontInfo "$SCRIPTDIR/example-output/mutatormath-Khula-090x-456.ufo"
ensureFontForgeFriendlyFontInfo "$SCRIPTDIR/example-output/mutatormath-Khula.ufo"