-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathpatch-font-names.sh
More file actions
executable file
·27 lines (23 loc) · 753 Bytes
/
patch-font-names.sh
File metadata and controls
executable file
·27 lines (23 loc) · 753 Bytes
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
#!/usr/bin/env bash
ttx *.ttf
function replace_name() {
cur_name=$1
tgt_name=$2
shift
shift
echo "$cur_name -> $tgt_name"
sed -i "s/\(<FullName value=.\)$cur_name /\1$tgt_name /" "$@"
sed -i "s/\(<FamilyName value=.\)$cur_name/\1$tgt_name/" "$@"
sed -i "s/^ $cur_name$/ $tgt_name/" "$@"
sed -i "s/^ $cur_name \([^UiP].*\)$/ $tgt_name \1/" "$@"
}
replace_name "Inter" "Roboto" Roboto-*.ttx
replace_name "Inter" "Roboto" RobotoStatic-*.ttx
replace_name "Inter" "Google Sans" GoogleSans-*.ttx
replace_name "Source Serif Pro" "Noto Serif" NotoSerif-*.ttx
replace_name "Fira Code" "Cutive Mono" CutiveMono.ttx
replace_name "Fira Code" "Droid Sans Mono" DroidSansMono.ttx
rm *.ttf
ttx *.ttx
rm *.ttx
rename otf ttf *