From 0ddb97906a4aca3d70e051d8491cbfc0c82bca67 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Tue, 24 Feb 2015 12:23:16 +0000 Subject: texk/ttfdump: Add a TrueType Collection test git-svn-id: svn://tug.org/texlive/trunk@36367 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/ttfdump/ChangeLog | 9 ++++- Build/source/texk/ttfdump/Makefile.am | 13 +++---- Build/source/texk/ttfdump/Makefile.in | 10 ++--- Build/source/texk/ttfdump/tests/test.ttc | Bin 0 -> 45876 bytes Build/source/texk/ttfdump/tests/ttfdump.gasp | 39 +++++++++++++++++++ Build/source/texk/ttfdump/tests/ttfdump.maxp | 47 +++++++++++++++++++++++ Build/source/texk/ttfdump/tests/ttfdump.test | 54 ++++++++++++++++++--------- 7 files changed, 142 insertions(+), 30 deletions(-) create mode 100644 Build/source/texk/ttfdump/tests/test.ttc create mode 100644 Build/source/texk/ttfdump/tests/ttfdump.gasp create mode 100644 Build/source/texk/ttfdump/tests/ttfdump.maxp (limited to 'Build') diff --git a/Build/source/texk/ttfdump/ChangeLog b/Build/source/texk/ttfdump/ChangeLog index ec43c77c70d..6997a11bd3d 100644 --- a/Build/source/texk/ttfdump/ChangeLog +++ b/Build/source/texk/ttfdump/ChangeLog @@ -1,3 +1,10 @@ +2015-02-24 Peter Breitenlohner + + * tests/ttfdump.test: Add a TrueType Collection test. + * tests/test.ttc (new): Additional test input. + * tests/ttfdump.gasp, tests/ttfdump.maxp (new): Expected output. + * Makefile.am: Adapted. + 2014-12-10 Peter Breitenlohner * libttf/pclt.c: Repalce "%02hx" => "%02x" for unsigned char. @@ -27,7 +34,7 @@ * libttf/os2.c: Index checking for string array elements. * tests/ttfdump.test: Add a test case for invalid array indices. * tests/bad.otf (new): Additional test input. - * tests/ttfdump.bad (new): Expected output.. + * tests/ttfdump.bad (new): Expected output. * Makefile.am: Adapted. 2013-01-31 Akihiro Sagawa diff --git a/Build/source/texk/ttfdump/Makefile.am b/Build/source/texk/ttfdump/Makefile.am index 21750d8e35e..6376f7e414d 100644 --- a/Build/source/texk/ttfdump/Makefile.am +++ b/Build/source/texk/ttfdump/Makefile.am @@ -1,6 +1,6 @@ ## Makefile.am for the TeX Live subdirectory texk/ttfdump/ ## -## Copyright (C) 2009-2014 Peter Breitenlohner +## Copyright (C) 2009-2015 Peter Breitenlohner ## You may freely use, modify and/or distribute this file. ## AM_CPPFLAGS = -I$(top_srcdir)/include $(KPATHSEA_INCLUDES) -DUNIX -DKPATHSEA @@ -91,18 +91,17 @@ DISTCLEANFILES = EXTRA_DIST += \ tests/FonetikaDaniaIwonaeRegular.ttf \ tests/bad.otf \ + tests/test.ttc \ tests/texmfhome.otf \ tests/ttfdump.bad \ + tests/ttfdump.gasp \ tests/ttfdump.glyf \ tests/ttfdump.gpos \ tests/ttfdump.gsub \ tests/ttfdump.head \ - tests/ttfdump.os_2 -DISTCLEANFILES += \ - FonetikaDaniaIwonaeRegular.ttf \ - texmfhome.otf \ - bad.otf \ - ttftest.* + tests/ttfdump.os_2 \ + tests/ttfdump.maxp +DISTCLEANFILES += ttftest.* ## Not used ## diff --git a/Build/source/texk/ttfdump/Makefile.in b/Build/source/texk/ttfdump/Makefile.in index 8be024783c5..c153ddb5faa 100644 --- a/Build/source/texk/ttfdump/Makefile.in +++ b/Build/source/texk/ttfdump/Makefile.in @@ -619,15 +619,15 @@ libttf_a_SOURCES = \ EXTRA_DIST = include/stack.h libttf/fixed.c libttf/interp.c \ libttf/stack.c docs/ttfdump.dvi docs/ttfdump.html \ docs/ttfdump.ps $(TESTS) tests/FonetikaDaniaIwonaeRegular.ttf \ - tests/bad.otf tests/texmfhome.otf tests/ttfdump.bad \ - tests/ttfdump.glyf tests/ttfdump.gpos tests/ttfdump.gsub \ - tests/ttfdump.head tests/ttfdump.os_2 ILX NOTE README.bg5 + tests/bad.otf tests/test.ttc tests/texmfhome.otf \ + tests/ttfdump.bad tests/ttfdump.gasp tests/ttfdump.glyf \ + tests/ttfdump.gpos tests/ttfdump.gsub tests/ttfdump.head \ + tests/ttfdump.os_2 tests/ttfdump.maxp ILX NOTE README.bg5 ttfdump_SOURCES = src/ttfdump.c LDADD = libttf.a $(KPATHSEA_LIBS) dist_man1_MANS = docs/ttfdump.1 TESTS = tests/ttfdump.test -DISTCLEANFILES = FonetikaDaniaIwonaeRegular.ttf texmfhome.otf bad.otf \ - ttftest.* +DISTCLEANFILES = ttftest.* all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am diff --git a/Build/source/texk/ttfdump/tests/test.ttc b/Build/source/texk/ttfdump/tests/test.ttc new file mode 100644 index 00000000000..2eea577e9c1 Binary files /dev/null and b/Build/source/texk/ttfdump/tests/test.ttc differ diff --git a/Build/source/texk/ttfdump/tests/ttfdump.gasp b/Build/source/texk/ttfdump/tests/ttfdump.gasp new file mode 100644 index 00000000000..50b64fcc171 --- /dev/null +++ b/Build/source/texk/ttfdump/tests/ttfdump.gasp @@ -0,0 +1,39 @@ +True Type Font File Dumper: v 0.5.5 +Copyright 1996-1998 ollie@ms1.hinet.net +Dumping File:(null) + + +TrueType Collection Header +-------------------------- +TTC version: 2.0 +Number of fonts: 2 +Offset of Directory #0: 36 +Offset of Directory #1: 812 + +Offset Table +------------ + sfnt version: 1.0 + number of tables: 12 + 0. 'FFTM' - checksum = 0x093b157f, offset = 0x00000698, len = 28 + 1. 'OS/2' - checksum = 0x53571407, offset = 0x000006b4, len = 86 + 2. 'cmap' - checksum = 0x69bcecb8, offset = 0x0000070c, len = 770 + 3. 'gasp' - checksum = 0xffff0003, offset = 0x00000a10, len = 8 + 4. 'glyf' - checksum = 0xe737e2ca, offset = 0x000020dc, len = 37464 + 5. 'head' - checksum = 0x057baae0, offset = 0x00000a18, len = 54 + 6. 'hhea' - checksum = 0x030a03d4, offset = 0x00000634, len = 36 + 7. 'hmtx' - checksum = 0x472950a3, offset = 0x00001aa4, len = 1058 + 8. 'loca' - checksum = 0x867eab72, offset = 0x00001ec8, len = 532 + 9. 'maxp' - checksum = 0x014f009f, offset = 0x00000658, len = 32 + 10. 'name' - checksum = 0x8e84692b, offset = 0x00000a50, len = 762 + 11. 'post' - checksum = 0xc0c5b5cd, offset = 0x00000d4c, len = 752 + +'gasp' Table - Grid-fitting And Scan-conversion Procedure +--------------------------------------------------------- +'gasp' version: 0 +numRanges: 1 + + gasp Range 0 + rangeMaxPPEM: 65535 + rangeGaspBehavior: 0x0002 + + diff --git a/Build/source/texk/ttfdump/tests/ttfdump.maxp b/Build/source/texk/ttfdump/tests/ttfdump.maxp new file mode 100644 index 00000000000..009784e55df --- /dev/null +++ b/Build/source/texk/ttfdump/tests/ttfdump.maxp @@ -0,0 +1,47 @@ +True Type Font File Dumper: v 0.5.5 +Copyright 1996-1998 ollie@ms1.hinet.net +Dumping File:(null) + + +TrueType Collection Header +-------------------------- +TTC version: 2.0 +Number of fonts: 2 +Offset of Directory #0: 36 +Offset of Directory #1: 812 + +Offset Table +------------ + sfnt version: 1.0 + number of tables: 12 + 0. 'FFTM' - checksum = 0x093b157f, offset = 0x00000698, len = 28 + 1. 'OS/2' - checksum = 0x5356145c, offset = 0x0000103c, len = 86 + 2. 'cmap' - checksum = 0xfaa4d5fa, offset = 0x00001094, len = 1014 + 3. 'gasp' - checksum = 0xffff0003, offset = 0x00000a10, len = 8 + 4. 'glyf' - checksum = 0xe737e2ca, offset = 0x000020dc, len = 37464 + 5. 'head' - checksum = 0x0579aae0, offset = 0x0000148c, len = 54 + 6. 'hhea' - checksum = 0x030a03d4, offset = 0x00000634, len = 36 + 7. 'hmtx' - checksum = 0x472950a3, offset = 0x00001aa4, len = 1058 + 8. 'loca' - checksum = 0x867eab72, offset = 0x00001ec8, len = 532 + 9. 'maxp' - checksum = 0x014f009f, offset = 0x00000658, len = 32 + 10. 'name' - checksum = 0x59125f2d, offset = 0x000014c4, len = 750 + 11. 'post' - checksum = 0xc0d3c00b, offset = 0x000017b4, len = 752 + +'maxp' Table - Maximum Profile +------------------------------ + 'maxp' version: 1.0 + numGlyphs: 265 + maxPoints: 156 + maxContours: 4 + maxCompositePoints: 0 + maxCompositeContours: 0 + maxZones: 2 + maxTwilightPoints: 0 + maxStorage: 1 + maxFunctionDefs: 1 + maxInstructionDefs: 0 + maxStackElements: 64 + maxSizeOfInstructions: 0 + maxComponentElements: 0 + maxCompoenetDepth: 0 + diff --git a/Build/source/texk/ttfdump/tests/ttfdump.test b/Build/source/texk/ttfdump/tests/ttfdump.test index 7592eaea5b0..e723c912785 100755 --- a/Build/source/texk/ttfdump/tests/ttfdump.test +++ b/Build/source/texk/ttfdump/tests/ttfdump.test @@ -1,6 +1,6 @@ #! /bin/sh -# Copyright (C) 2011-2013 Peter Breitenlohner +# Copyright (C) 2011-2015 Peter Breitenlohner # You may freely use, modify and/or distribute this file. TEXMFCNF=$srcdir/../kpathsea @@ -9,41 +9,61 @@ export TEXMFCNF TTFONTS failed= -rm -rf FonetikaDaniaIwonaeRegular.ttf texmfhome.otf ttftest.* bad.* -cp $srcdir/tests/FonetikaDaniaIwonaeRegular.ttf . -cp $srcdir/tests/texmfhome.otf . -cp $srcdir/tests/bad.otf . +rm -rf ttftest.* +#rm -rf FonetikaDaniaIwonaeRegular.ttf bad.otf test.ttc texmfhome.otf ttftest.* +#cp $srcdir/tests/FonetikaDaniaIwonaeRegular.ttf . +#cp $srcdir/tests/bad.otf . +#cp $srcdir/tests/test.ttc . +#cp $srcdir/tests/texmfhome.otf . -./ttfdump -t glyf -g 1 -o ttftest.glyf FonetikaDaniaIwonaeRegular.ttf \ +echo "*** ttfdump -t glyf -g 1 -o ttftest.glyf FonetikaDaniaIwonaeRegular.ttf" \ + && ./ttfdump -t glyf -g 1 -o ttftest.glyf FonetikaDaniaIwonaeRegular.ttf \ && diff -b $srcdir/tests/ttfdump.glyf ttftest.glyf \ - && echo "ttfdump.glyf tests OK" \ + && echo "ttfdump.glyf tests OK" && echo \ || failed="$failed ttfdump.glyf" -./ttfdump -t GPOS -o ttftest.gpos FonetikaDaniaIwonaeRegular.ttf \ +echo "*** ttfdump -t GPOS -o ttftest.gpos FonetikaDaniaIwonaeRegular.ttf" \ + && ./ttfdump -t GPOS -o ttftest.gpos FonetikaDaniaIwonaeRegular.ttf \ && diff -b $srcdir/tests/ttfdump.gpos ttftest.gpos \ - && echo "ttfdump.gpos tests OK" \ + && echo "ttfdump.gpos tests OK" && echo \ || failed="$failed ttfdump.gpos" -./ttfdump -t GSUB -o ttftest.gsub FonetikaDaniaIwonaeRegular.ttf \ +echo "*** ttfdump -t GSUB -o ttftest.gsub FonetikaDaniaIwonaeRegular.ttf" \ + && ./ttfdump -t GSUB -o ttftest.gsub FonetikaDaniaIwonaeRegular.ttf \ && diff -b $srcdir/tests/ttfdump.gsub ttftest.gsub \ - && echo "ttfdump.gsub tests OK" \ + && echo "ttfdump.gsub tests OK" && echo \ || failed="$failed ttfdump.gsub" -./ttfdump -t head FonetikaDaniaIwonaeRegular.ttf >ttftest.head \ +echo "*** ttfdump -t head FonetikaDaniaIwonaeRegular.ttf >ttftest.head" \ + && ./ttfdump -t head FonetikaDaniaIwonaeRegular.ttf >ttftest.head \ && diff -b $srcdir/tests/ttfdump.head ttftest.head \ - && echo "ttfdump.head tests OK" \ + && echo "ttfdump.head tests OK" && echo \ || failed="$failed ttfdump.head" -./ttfdump -t OS/2 texmfhome.otf >ttftest.os_2 \ +echo "*** ttfdump -t OS/2 texmfhome.otf >ttftest.os_2" \ + && ./ttfdump -t OS/2 texmfhome.otf >ttftest.os_2 \ && diff -b $srcdir/tests/ttfdump.os_2 ttftest.os_2 \ - && echo "ttfdump.os_2 tests OK" \ + && echo "ttfdump.os_2 tests OK" && echo \ || failed="$failed ttfdump.os_2" -./ttfdump -t OS/2 bad.otf >ttftest.bad \ +echo "*** ttfdump -t OS/2 bad.otf >ttftest.bad" \ + && ./ttfdump -t OS/2 bad.otf >ttftest.bad \ && diff -b $srcdir/tests/ttfdump.bad ttftest.bad \ - && echo "ttfdump.bad tests OK" \ + && echo "ttfdump.bad tests OK" && echo \ || failed="$failed ttfdump.bad" +echo "*** ttfdump -t gasp -c 0 test.ttc >ttftest.gasp" \ + && ./ttfdump -t gasp -c 0 test.ttc >ttftest.gasp \ + && diff -b $srcdir/tests/ttfdump.gasp ttftest.gasp \ + && echo "ttfdump.gasp tests OK" && echo \ + || failed="$failed ttfdump.gasp" + +echo "*** ttfdump -t maxp -c 1 test.ttc >ttftest.maxp" \ + && ./ttfdump -t maxp -c 1 test.ttc >ttftest.maxp \ + && diff -b $srcdir/tests/ttfdump.maxp ttftest.maxp \ + && echo "ttfdump.maxp tests OK" && echo \ + || failed="$failed ttfdump.maxp" + test -z "$failed" && exit 0 echo "failed tests:$failed" exit 1 -- cgit v1.2.3