| 1 |
#! /bin/sh -vx |
| 2 |
# $Id: ttf2pk.test 67914 2023-08-13 13:51:34Z takuji $ |
| 3 |
# Copyright 2017 Karl Berry <[email protected]> |
| 4 |
# Copyright 2011, 2012 Peter Breitenlohner <[email protected]> |
| 5 |
# You may freely use, modify and/or distribute this file. |
| 6 |
|
| 7 |
BinDir=${BinDir:-.} |
| 8 |
ExeExt=${ExeExt:-} |
| 9 |
_tftopl=tftopl$ExeExt |
| 10 |
_pktype=pktype$ExeExt |
| 11 |
_ttf2tfm=$BinDir/ttf2tfm$ExeExt |
| 12 |
_ttf2pk=$BinDir/ttf2pk$ExeExt |
| 13 |
|
| 14 |
# pre-generated test results in the repository are stored in LF |
| 15 |
# but the output might be written in CRLF on some platform. |
| 16 |
# if 'diff --strip-trailing-cr' is available, exploit it. |
| 17 |
# (useful for tests on win32 binaries run on MSYS shell) |
| 18 |
DIFF="diff" |
| 19 |
$DIFF --strip-trailing-cr $0 $0 \ |
| 20 |
&& DIFF="diff --strip-trailing-cr" || echo |
| 21 |
|
| 22 |
rc=0 |
| 23 |
|
| 24 |
rm -f GenR-ec.vpl GenR102-* ipaexg-* |
| 25 |
|
| 26 |
TEXMFCNF=$srcdir/../kpathsea |
| 27 |
TEXFONTS=".;$srcdir/tests" |
| 28 |
TTF2PKINPUTS=$srcdir/tests |
| 29 |
SFDFONTS="$srcdir/data;$srcdir/tests" |
| 30 |
PATH=../web2c:$PATH |
| 31 |
|
| 32 |
export TEXMFCNF TEXFONTS TTF2PKINPUTS SFDFONTS PATH |
| 33 |
|
| 34 |
$_ttf2tfm GenR102 -u -q -N -T gentium-ec -v GenR-ec GenR102-ec >GenR102-ec.map || rc=1 |
| 35 |
$DIFF $srcdir/tests/GenR102-ec.map GenR102-ec.map || rc=2 |
| 36 |
$DIFF $srcdir/tests/GenR-ec.vpl GenR-ec.vpl || rc=3 |
| 37 |
|
| 38 |
$_ttf2pk -q GenR102-ec 100 || rc=4 |
| 39 |
|
| 40 |
$_tftopl GenR102-ec GenR102-ec || exit 77 |
| 41 |
diff $srcdir/tests/GenR102-ec.pl GenR102-ec.pl || rc=5 |
| 42 |
$_pktype GenR102-ec.100pk >GenR102-ec.typ || exit 77 |
| 43 |
|
| 44 |
echo passed GenR102-ec test |
| 45 |
|
| 46 |
$_ttf2tfm GenR102 -q GenR102-h@UBig5@ >GenR102-h.map || rc=6 |
| 47 |
$DIFF $srcdir/tests/GenR102-h.map GenR102-h.map || rc=7 |
| 48 |
|
| 49 |
for sf in 00 01 02 24; do |
| 50 |
|
| 51 |
$_ttf2pk -q GenR102-h$sf 100 || rc=8 |
| 52 |
|
| 53 |
$_tftopl GenR102-h$sf GenR102-h$sf || exit 77 |
| 54 |
$_pktype GenR102-h$sf.100pk >GenR102-h$sf.typ || exit 77 |
| 55 |
|
| 56 |
done |
| 57 |
|
| 58 |
echo passed GenR102-h test |
| 59 |
|
| 60 |
$_ttf2tfm GenR102 -q -x GenR102-v@UBig5@ >GenR102-v.map || rc=9 |
| 61 |
$DIFF $srcdir/tests/GenR102-v.map GenR102-v.map || rc=10 |
| 62 |
|
| 63 |
for sf in 00 01 02 24; do |
| 64 |
|
| 65 |
$_ttf2pk -q GenR102-v$sf 100 || rc=11 |
| 66 |
|
| 67 |
$_tftopl GenR102-v$sf GenR102-v$sf || exit 77 |
| 68 |
$_pktype GenR102-v$sf.100pk >GenR102-v$sf.typ || exit 77 |
| 69 |
|
| 70 |
done |
| 71 |
|
| 72 |
echo passed GenR102-v test |
| 73 |
|
| 74 |
$_ttf2tfm ipaexg -q ipaexg-h@Test@ >ipaexg-h.map || rc=12 |
| 75 |
$DIFF $srcdir/tests/ipaexg-h.map ipaexg-h.map || rc=13 |
| 76 |
|
| 77 |
$_ttf2pk -q ipaexg-h03 100 || rc=14 |
| 78 |
|
| 79 |
$_tftopl ipaexg-h03 ipaexg-h03 || exit 77 |
| 80 |
diff $srcdir/tests/ipaexg-h03.pl ipaexg-h03.pl || rc=15 |
| 81 |
$_pktype ipaexg-h03.100pk >ipaexg-h03.typ || exit 77 |
| 82 |
|
| 83 |
echo passed ipaexg-h test |
| 84 |
|
| 85 |
$_ttf2tfm ipaexg -q -x ipaexg-v@Test@ >ipaexg-v.map || rc=16 |
| 86 |
$DIFF $srcdir/tests/ipaexg-v.map ipaexg-v.map || rc=17 |
| 87 |
|
| 88 |
$_ttf2pk -q ipaexg-v03 100 || rc=18 |
| 89 |
|
| 90 |
$_tftopl ipaexg-v03 ipaexg-v03 || exit 77 |
| 91 |
diff $srcdir/tests/ipaexg-v03.pl ipaexg-v03.pl || rc=19 |
| 92 |
$_pktype ipaexg-v03.100pk >ipaexg-v03.typ || exit 77 |
| 93 |
|
| 94 |
echo passed ipaexg-v test |
| 95 |
|
| 96 |
exit $rc |