diff --git a/android/NotoSansCJK-wght-400-900.ttf.ttc b/android/NotoSansCJK-wght-400-900.ttf.ttc new file mode 100644 index 0000000..95fdb60 Binary files /dev/null and b/android/NotoSansCJK-wght-400-900.ttf.ttc differ diff --git a/android/NotoSansCJK-wght-400-900.ttf.woff2 b/android/NotoSansCJK-wght-400-900.ttf.woff2 new file mode 100644 index 0000000..82ac94a Binary files /dev/null and b/android/NotoSansCJK-wght-400-900.ttf.woff2 differ diff --git a/google-fonts/NotoSansCJK[wght].ttf.ttc b/android/NotoSerifCJK-wght-400-900.ttf.ttc similarity index 76% rename from google-fonts/NotoSansCJK[wght].ttf.ttc rename to android/NotoSerifCJK-wght-400-900.ttf.ttc index 1f74229..c88a1a0 100644 Binary files a/google-fonts/NotoSansCJK[wght].ttf.ttc and b/android/NotoSerifCJK-wght-400-900.ttf.ttc differ diff --git a/android/NotoSerifCJK-wght-400-900.ttf.woff2 b/android/NotoSerifCJK-wght-400-900.ttf.woff2 new file mode 100644 index 0000000..7fcf4c0 Binary files /dev/null and b/android/NotoSerifCJK-wght-400-900.ttf.woff2 differ diff --git a/build-gf.sh b/build-gf.sh index feeb2ab..c58d633 100644 --- a/build-gf.sh +++ b/build-gf.sh @@ -1,10 +1,43 @@ #!/bin/sh -SERIF_SOURCES=Serif/Variable/TTF/Subset/*ttf -SANS_SOURCES=Sans/Variable/TTF/Subset/*ttf +STYLE=ttf + +echo "Building for Google Fonts" +# This is the GF deliverables; these are subset +SERIF_SOURCES=Serif/Variable/*/Subset/*$STYLE +SANS_SOURCES=Sans/Variable/*/Subset/*$STYLE python3 google-fonts/hotfix.py --output-dir=google-fonts $SERIF_SOURCES $SANS_SOURCES -add-chws -o google-fonts google-fonts/*ttf +add-chws -o google-fonts google-fonts/*$STYLE + +echo "Building for Android" +# Instance for Android +# We don't use the subset versions here because we want to +# use the shared glyf/gvar table in the eventual TTC +SERIF_SOURCES=Serif/Variable/*/*$STYLE +SANS_SOURCES=Sans/Variable/*/*$STYLE + +mkdir -p android/instances + +VARIATION="wght=400:900" +VARIATION_FILENAME=`echo $VARIATION | sed "s/:/-/" | sed "s/=/-/"` + +for i in $SANS_SOURCES $SERIF_SOURCES +do + OUTFILE=android/instances/`basename $i | sed "s/.$STYLE/-$VARIATION_FILENAME.$STYLE/"` + echo "$i => " $OUTFILE + if [[ $VARIATION == "full" ]] + then + cp $i $OUTFILE + else + fonttools varLib.instancer -o $OUTFILE $i $VARIATION + fi + # Hotfix in place + python3 google-fonts/hotfix.py -o $OUTFILE $OUTFILE +done +add-chws -o android/instances/ android/instances/*ttf # Build TTCs for Android -fonttools ttLib -o google-fonts/'NotoSansCJK[wght].ttf.ttc' google-fonts/NotoSans*.ttf -fonttools ttLib -o google-fonts/'NotoSerifCJK[wght].ttf.ttc' google-fonts/NotoSerif*.ttf +fonttools ttLib -o android/'NotoSansCJK'-$VARIATION_FILENAME.$STYLE.ttc android/instances/NotoSans*.$STYLE +woff2_compress android/'NotoSansCJK'-$VARIATION_FILENAME.$STYLE.ttc +fonttools ttLib -o android/'NotoSerifCJK'-$VARIATION_FILENAME.$STYLE.ttc android/instances/NotoSerif*.$STYLE +woff2_compress android/'NotoSerifCJK'-$VARIATION_FILENAME.$STYLE.ttc diff --git a/google-fonts/NotoSerifCJK[wght].ttf.ttc b/google-fonts/NotoSerifCJK[wght].ttf.ttc deleted file mode 100644 index cebdd83..0000000 Binary files a/google-fonts/NotoSerifCJK[wght].ttf.ttc and /dev/null differ