File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # 1. Set the path to the downloaded Hack repo here first
4
+ HACK_PATH=" "
5
+
6
+ # 2. List your alternate glyphs here
7
+ declare -a alternates=(
8
+ " u00EC-slab"
9
+ " u00ED-slab"
10
+ " u00EF-slab"
11
+ " u012B-slab"
12
+ " u012D-slab"
13
+ " u012F-slab"
14
+ " u0030-diamond"
15
+ " u0069-slab"
16
+ " u0129-slab"
17
+ " u0131-slab"
18
+ " u0456-slab"
19
+ " u0457-slab"
20
+ )
21
+
22
+ # 3. Run this script and enjoy!
23
+
24
+ # ------------------------------------------------------------------------------------------------ #
25
+
26
+ if [ -z $HACK_PATH ]; then
27
+ echo " ❌ Set the HACK_PATH variable in this script to your downloaded Hack repo root."
28
+ exit 1
29
+ fi
30
+
31
+ declare -a styles=(" Regular" " Bold" " Italic" " BoldItalic" )
32
+
33
+ for alternate in " ${alternates[@]} "
34
+ do
35
+ for style in " ${styles[@]} "
36
+ do
37
+ stylePath=" ${HACK_PATH} /source/Hack-${style} .ufo/glyphs"
38
+ lowercaseStyle=` echo " $style " | tr ' [:upper:]' ' [:lower:]' `
39
+ alternatePath=" ./glyphs/${alternate} /${lowercaseStyle} /*.glif"
40
+
41
+ cp $alternatePath $stylePath
42
+ if [ $? -ne 0 ]; then
43
+ echo " ❌ Aborting patching of Hack, check errors above."
44
+ exit 1
45
+ fi
46
+ done
47
+
48
+ echo " ✅ Patched $alternate "
49
+ done
50
+
51
+ echo
52
+ echo " All done! Now go to the Hack repo and build the font files."
You can’t perform that action at this time.
0 commit comments