| 1 |
#! /bin/sh -vx |
| 2 |
# $Id: ttfdump.test 67913 2023-08-13 13:51:27Z takuji $ |
| 3 |
# Copyright 2017 Karl Berry <[email protected]> |
| 4 |
# Copyright 2011-2015 Peter Breitenlohner <[email protected]> |
| 5 |
# You may freely use, modify and/or distribute this file. |
| 6 |
|
| 7 |
BinDir=${BinDir:-.} |
| 8 |
ExeExt=${ExeExt:-} |
| 9 |
_ttfdump=$BinDir/ttfdump$ExeExt |
| 10 |
|
| 11 |
# pre-generated test results in the repository are stored in LF |
| 12 |
# but the output might be written in CRLF on some platform. |
| 13 |
# if 'diff --strip-trailing-cr' is available, exploit it. |
| 14 |
# (useful for tests on win32 binaries run on MSYS shell) |
| 15 |
DIFF="diff" |
| 16 |
$DIFF --strip-trailing-cr $0 $0 \ |
| 17 |
&& DIFF="diff --strip-trailing-cr" || echo |
| 18 |
|
| 19 |
TEXMFCNF=$srcdir/../kpathsea |
| 20 |
TTFONTS=$srcdir/tests |
| 21 |
export TEXMFCNF TTFONTS |
| 22 |
|
| 23 |
failed= |
| 24 |
|
| 25 |
rm -rf ttftest.* |
| 26 |
#rm -rf FonetikaDaniaIwonaeRegular.ttf bad.otf test.ttc texmfhome.otf ttftest.* |
| 27 |
#cp $srcdir/tests/FonetikaDaniaIwonaeRegular.ttf . |
| 28 |
#cp $srcdir/tests/bad.otf . |
| 29 |
#cp $srcdir/tests/test.ttc . |
| 30 |
#cp $srcdir/tests/texmfhome.otf . |
| 31 |
|
| 32 |
echo "*** ttfdump -t glyf -g 1 -o ttftest.glyf FonetikaDaniaIwonaeRegular.ttf" \ |
| 33 |
&& $_ttfdump -t glyf -g 1 -o ttftest.glyf FonetikaDaniaIwonaeRegular.ttf \ |
| 34 |
&& diff -b $srcdir/tests/ttfdump.glyf ttftest.glyf \ |
| 35 |
&& echo "ttfdump.glyf tests OK" && echo \ |
| 36 |
|| failed="$failed ttfdump.glyf" |
| 37 |
|
| 38 |
echo "*** ttfdump -t GPOS -o ttftest.gpos FonetikaDaniaIwonaeRegular.ttf" \ |
| 39 |
&& $_ttfdump -t GPOS -o ttftest.gpos FonetikaDaniaIwonaeRegular.ttf \ |
| 40 |
&& diff -b $srcdir/tests/ttfdump.gpos ttftest.gpos \ |
| 41 |
&& echo "ttfdump.gpos tests OK" && echo \ |
| 42 |
|| failed="$failed ttfdump.gpos" |
| 43 |
|
| 44 |
echo "*** ttfdump -t GSUB -o ttftest.gsub FonetikaDaniaIwonaeRegular.ttf" \ |
| 45 |
&& $_ttfdump -t GSUB -o ttftest.gsub FonetikaDaniaIwonaeRegular.ttf \ |
| 46 |
&& diff -b $srcdir/tests/ttfdump.gsub ttftest.gsub \ |
| 47 |
&& echo "ttfdump.gsub tests OK" && echo \ |
| 48 |
|| failed="$failed ttfdump.gsub" |
| 49 |
|
| 50 |
echo "*** ttfdump -t head FonetikaDaniaIwonaeRegular.ttf >ttftest.head" \ |
| 51 |
&& $_ttfdump -t head FonetikaDaniaIwonaeRegular.ttf >ttftest.head \ |
| 52 |
&& $DIFF -b $srcdir/tests/ttfdump.head ttftest.head \ |
| 53 |
&& echo "ttfdump.head tests OK" && echo \ |
| 54 |
|| failed="$failed ttfdump.head" |
| 55 |
|
| 56 |
echo "*** ttfdump -t OS/2 texmfhome.otf >ttftest.os_2" \ |
| 57 |
&& $_ttfdump -t OS/2 texmfhome.otf >ttftest.os_2 \ |
| 58 |
&& $DIFF -b $srcdir/tests/ttfdump.os_2 ttftest.os_2 \ |
| 59 |
&& echo "ttfdump.os_2 tests OK" && echo \ |
| 60 |
|| failed="$failed ttfdump.os_2" |
| 61 |
|
| 62 |
echo "*** ttfdump -t OS/2 bad.otf >ttftest.bad" \ |
| 63 |
&& $_ttfdump -t OS/2 bad.otf >ttftest.bad \ |
| 64 |
&& $DIFF -b $srcdir/tests/ttfdump.bad ttftest.bad \ |
| 65 |
&& echo "ttfdump.bad tests OK" && echo \ |
| 66 |
|| failed="$failed ttfdump.bad" |
| 67 |
|
| 68 |
echo "*** ttfdump -t gasp -c 0 test.ttc >ttftest.gasp" \ |
| 69 |
&& $_ttfdump -t gasp -c 0 test.ttc >ttftest.gasp \ |
| 70 |
&& $DIFF -b $srcdir/tests/ttfdump.gasp ttftest.gasp \ |
| 71 |
&& echo "ttfdump.gasp tests OK" && echo \ |
| 72 |
|| failed="$failed ttfdump.gasp" |
| 73 |
|
| 74 |
echo "*** ttfdump -t maxp -c 1 test.ttc >ttftest.maxp" \ |
| 75 |
&& $_ttfdump -t maxp -c 1 test.ttc >ttftest.maxp \ |
| 76 |
&& $DIFF -b $srcdir/tests/ttfdump.maxp ttftest.maxp \ |
| 77 |
&& echo "ttfdump.maxp tests OK" && echo \ |
| 78 |
|| failed="$failed ttfdump.maxp" |
| 79 |
|
| 80 |
test -z "$failed" && exit 0 |
| 81 |
echo "failed tests:$failed" |
| 82 |
exit 1 |
| 83 |
|