-
Notifications
You must be signed in to change notification settings - Fork 7
/
fluentui.sh
executable file
·52 lines (40 loc) · 1.07 KB
/
fluentui.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
#!/usr/bin/env bash
set -e
STYLE="$1"
if [ -z "$STYLE" ]; then
echo "Usage: $0 <Style>"
echo "Style: Color, Flat, High Contrast"
exit 1
fi
FONT_NAME=AppleColorEmoji@2x
NAME=fluentui
ASSETS="$STYLE"
MAX_SIZE=96
cd "$ASSETS"
../../image-sizes.sh false
cd ..
echo "Preparing SVGs..."
python3 $NAME-prepare.py ../../fluentui-emoji/assets . "$STYLE"
mv "$ASSETS"/*.svg "$ASSETS"/images/$MAX_SIZE
cd "$ASSETS"/images/$MAX_SIZE
echo "Converting SVGs into PNGs..."
if [ "$STYLE" == 'Color' ]; then
echo "Optimizing SVGs..."
svgo -f . &> /dev/null
fi
for svg in $(find . -type f -name '*.svg')
do
fname=$(basename $svg)
rsvg-convert -a -h $MAX_SIZE $svg -o ${fname/.svg/.png}
done
rm -f *.svg
cd ../..
echo "Resizing and optimizing PNGs..."
../../resize.sh false false false
cd ..
python3 $NAME.py ../apple/${FONT_NAME}_00.ttf "$STYLE" &
python3 $NAME.py ../apple/${FONT_NAME}_01.ttf "$STYLE" &
wait -n
otf2otc "$STYLE"-${FONT_NAME}_00.ttf "$STYLE"-${FONT_NAME}_01.ttf -o $NAME-"$STYLE".ttc
rm -f *_00.ttf *_01.ttf
echo "Output file at $NAME/$NAME-$STYLE.ttc"