diff options
author | Akshay <[email protected]> | 2020-04-13 11:44:14 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2020-04-13 11:44:14 +0100 |
commit | edeb62c33963c955d1c995468aaa4c8fcc30621e (patch) | |
tree | fd8bae8f7adb6b5caf7f31741876cdfb2104b8fd /build.sh | |
parent | 2e34eef316cff2211ef2a731237a02797f94f693 (diff) |
add experimental build script
Diffstat (limited to 'build.sh')
-rwxr-xr-x | build.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..2c7cc06 --- /dev/null +++ b/build.sh | |||
@@ -0,0 +1,30 @@ | |||
1 | #! /usr/bin/env bash | ||
2 | |||
3 | export BNP="BitsNPicas.jar" | ||
4 | |||
5 | ff_filter() { | ||
6 | fontforge -c 'open(argv[1]).generate(argv[2])' "$1" "$2" | ||
7 | } | ||
8 | |||
9 | ttf_filter() { | ||
10 | # 1 - source file | ||
11 | # 2 - destination file | ||
12 | java -jar "$BNP" convertbitmap -f ttf -o "$2" "$1" | ||
13 | } | ||
14 | |||
15 | export_fonts() { | ||
16 | for i in src/*; do | ||
17 | local file_name=$(basename "${i%.*}") | ||
18 | ttf_filter "$i" "build/ttf/$file_name.ttf" | ||
19 | ff_filter "$i" "build/otb/$file_name.otb" | ||
20 | ff_filter "$i" "build/bdf/$file_name.bdf" | ||
21 | done | ||
22 | } | ||
23 | |||
24 | main() { | ||
25 | rm -rf build | ||
26 | mkdir -p build/{otb,ttf,bdf} | ||
27 | export_fonts | ||
28 | } | ||
29 | |||
30 | main | ||