Current fonttools (3.9.1) generate subset-file called font.subset.ttf instead of older font.ttf.subset
This commit is contained in:
parent
c2a9de15f5
commit
8d256841ca
|
@ -48,20 +48,20 @@ pyftsubset \
|
||||||
--no-hinting \
|
--no-hinting \
|
||||||
"$dir/font.ttf" \
|
"$dir/font.ttf" \
|
||||||
--text="$text"
|
--text="$text"
|
||||||
if ! test -s "$dir/font.ttf.subset"; then
|
if ! test -s "$dir/font.subset.ttf"; then
|
||||||
echo "Subsetter didn't produce nonempty subset font in $dir/font.ttf.subset" >&2
|
echo "Subsetter didn't produce nonempty subset font in $dir/font.subset.ttf" >&2
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Verify that subset font produces same glyphs!
|
# Verify that subset font produces same glyphs!
|
||||||
glyphs_subset=`echo "$text" | $hb_shape $options "$dir/font.ttf.subset"`
|
glyphs_subset=`echo "$text" | $hb_shape $options "$dir/font.subset.ttf"`
|
||||||
|
|
||||||
if ! test "x$glyphs" = "x$glyphs_subset"; then
|
if ! test "x$glyphs" = "x$glyphs_subset"; then
|
||||||
echo "Subset font produced different glyphs!" >&2
|
echo "Subset font produced different glyphs!" >&2
|
||||||
echo "Perhaps font doesn't have glyph names; checking visually..." >&2
|
echo "Perhaps font doesn't have glyph names; checking visually..." >&2
|
||||||
hb_view=${hb_shape/shape/view}
|
hb_view=${hb_shape/shape/view}
|
||||||
echo "$text" | $hb_view $options "$dir/font.ttf" --output-format=png --output-file="$dir/orig.png"
|
echo "$text" | $hb_view $options "$dir/font.ttf" --output-format=png --output-file="$dir/orig.png"
|
||||||
echo "$text" | $hb_view $options "$dir/font.ttf.subset" --output-format=png --output-file="$dir/subset.png"
|
echo "$text" | $hb_view $options "$dir/font.subset.ttf" --output-format=png --output-file="$dir/subset.png"
|
||||||
if ! cmp "$dir/orig.png" "$dir/subset.png"; then
|
if ! cmp "$dir/orig.png" "$dir/subset.png"; then
|
||||||
echo "Images differ. Please inspect $dir/*.png." >&2
|
echo "Images differ. Please inspect $dir/*.png." >&2
|
||||||
echo "$glyphs"
|
echo "$glyphs"
|
||||||
|
@ -74,9 +74,9 @@ if ! test "x$glyphs" = "x$glyphs_subset"; then
|
||||||
glyphs=$glyphs_subset
|
glyphs=$glyphs_subset
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sha1sum=`sha1sum "$dir/font.ttf.subset" | cut -d' ' -f1`
|
sha1sum=`sha1sum "$dir/font.subset.ttf" | cut -d' ' -f1`
|
||||||
subset="fonts/sha1sum/$sha1sum.ttf"
|
subset="fonts/sha1sum/$sha1sum.ttf"
|
||||||
mv "$dir/font.ttf.subset" "$subset"
|
mv "$dir/font.subset.ttf" "$subset"
|
||||||
|
|
||||||
# There ought to be an easier way to do this, but it escapes me...
|
# There ought to be an easier way to do this, but it escapes me...
|
||||||
unicodes_file=`mktemp`
|
unicodes_file=`mktemp`
|
||||||
|
|
Loading…
Reference in New Issue