summaryrefslogtreecommitdiff
path: root/Build/source/texk/ttfdump/tests
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2011-12-01 13:24:38 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2011-12-01 13:24:38 +0000
commit3131715fb5bce44da6c7584315237731aa752eba (patch)
treeb4e748ed3b19d603c4ac1b29f33340c196003e0e /Build/source/texk/ttfdump/tests
parent9417d53067c450b541cecd8c3ae224e5d17b8e54 (diff)
ttfdump: Added functionality
- do not segfault for fonts without loca table - allow cmap subtables with format 8, 10, 12, and 13 - handle GPOS and GSUB tables - additional tests git-svn-id: svn://tug.org/texlive/trunk@24713 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/ttfdump/tests')
-rw-r--r--Build/source/texk/ttfdump/tests/ttfdump.glyf54
-rw-r--r--Build/source/texk/ttfdump/tests/ttfdump.gpos47
-rw-r--r--Build/source/texk/ttfdump/tests/ttfdump.gsub35
-rw-r--r--Build/source/texk/ttfdump/tests/ttfdump.head44
-rwxr-xr-xBuild/source/texk/ttfdump/tests/ttfdump.test30
5 files changed, 156 insertions, 54 deletions
diff --git a/Build/source/texk/ttfdump/tests/ttfdump.glyf b/Build/source/texk/ttfdump/tests/ttfdump.glyf
index be977900774..b2754800ff4 100644
--- a/Build/source/texk/ttfdump/tests/ttfdump.glyf
+++ b/Build/source/texk/ttfdump/tests/ttfdump.glyf
@@ -1,29 +1,29 @@
True Type Font File Dumper: v 0.5.5
-Copyright 1996-1998 ollie@ms1.hinet.net
+Copyright 1996-1998 ollie@ms1.hinet.net
Dumping File:FonetikaDaniaIwonaeRegular.ttf
-Offset Table
-------------
- sfnt version:
+Offset Table
+------------
+ sfnt version: 1.0
number of tables: 14
- 0. 'GPOS' - checksum = 0xd7f8e75c, offset = 0x00001cd0, len = 80
- 1. 'GSUB' - checksum = 0x6c91748f, offset = 0x00001cb0, len = 32
- 2. 'OS/2' - checksum = 0x55d6fec3, offset = 0x00000168, len = 86
- 3. 'cmap' - checksum = 0x987c2758, offset = 0x0000028c, len = 482
- 4. 'cvt ' - checksum = 0x00210279, offset = 0x00000470, len = 4
- 5. 'gasp' - checksum = 0xffff0003, offset = 0x00001ca8, len = 8
- 6. 'glyf' - checksum = 0xd071d50c, offset = 0x000004dc, len = 4946
- 7. 'head' - checksum = 0xe43df9fb, offset = 0x000000ec, len = 54
- 8. 'hhea' - checksum = 0x05e9014f, offset = 0x00000124, len = 36
- 9. 'hmtx' - checksum = 0x4ca30981, offset = 0x000001c0, len = 202
- 10. 'loca' - checksum = 0x6c437107, offset = 0x00000474, len = 104
- 11. 'maxp' - checksum = 0x0079007b, offset = 0x00000148, len = 32
- 12. 'name' - checksum = 0x31984665, offset = 0x00001830, len = 1002
- 13. 'post' - checksum = 0x0aef76ec, offset = 0x00001c1c, len = 140
+ 0. 'GPOS' - checksum = 0xd7f8e75c, offset = 0x00001cd0, len = 80
+ 1. 'GSUB' - checksum = 0x6c91748f, offset = 0x00001cb0, len = 32
+ 2. 'OS/2' - checksum = 0x55d6fec3, offset = 0x00000168, len = 86
+ 3. 'cmap' - checksum = 0x987c2758, offset = 0x0000028c, len = 482
+ 4. 'cvt ' - checksum = 0x00210279, offset = 0x00000470, len = 4
+ 5. 'gasp' - checksum = 0xffff0003, offset = 0x00001ca8, len = 8
+ 6. 'glyf' - checksum = 0xd071d50c, offset = 0x000004dc, len = 4946
+ 7. 'head' - checksum = 0xe43df9fb, offset = 0x000000ec, len = 54
+ 8. 'hhea' - checksum = 0x05e9014f, offset = 0x00000124, len = 36
+ 9. 'hmtx' - checksum = 0x4ca30981, offset = 0x000001c0, len = 202
+ 10. 'loca' - checksum = 0x6c437107, offset = 0x00000474, len = 104
+ 11. 'maxp' - checksum = 0x0079007b, offset = 0x00000148, len = 32
+ 12. 'name' - checksum = 0x31984665, offset = 0x00001830, len = 1002
+ 13. 'post' - checksum = 0x0aef76ec, offset = 0x00001c1c, len = 140
Glyph 1.
- numberOfContours: 2
+ numberOfContours: 2
xMin: 33
yMin: 0
xMax: 366
@@ -38,14 +38,14 @@ Glyph 1.
Flags
-----
- 0: YDual XDual X-Short On
- 1: XDual On
- 2: YDual On
- 3: XDual On
- 4: YDual Y-Short On
- 5: YDual On
- 6: XDual On
- 7: YDual On
+ 0: YDual XDual X-Short On
+ 1: XDual On
+ 2: YDual On
+ 3: XDual On
+ 4: YDual Y-Short On
+ 5: YDual On
+ 6: XDual On
+ 7: YDual On
Coordinates
-----------
diff --git a/Build/source/texk/ttfdump/tests/ttfdump.gpos b/Build/source/texk/ttfdump/tests/ttfdump.gpos
new file mode 100644
index 00000000000..9a07bda4a02
--- /dev/null
+++ b/Build/source/texk/ttfdump/tests/ttfdump.gpos
@@ -0,0 +1,47 @@
+True Type Font File Dumper: v 0.5.5
+Copyright 1996-1998 ollie@ms1.hinet.net
+Dumping File:FonetikaDaniaIwonaeRegular.ttf
+
+
+Offset Table
+------------
+ sfnt version: 1.0
+ number of tables: 14
+ 0. 'GPOS' - checksum = 0xd7f8e75c, offset = 0x00001cd0, len = 80
+ 1. 'GSUB' - checksum = 0x6c91748f, offset = 0x00001cb0, len = 32
+ 2. 'OS/2' - checksum = 0x55d6fec3, offset = 0x00000168, len = 86
+ 3. 'cmap' - checksum = 0x987c2758, offset = 0x0000028c, len = 482
+ 4. 'cvt ' - checksum = 0x00210279, offset = 0x00000470, len = 4
+ 5. 'gasp' - checksum = 0xffff0003, offset = 0x00001ca8, len = 8
+ 6. 'glyf' - checksum = 0xd071d50c, offset = 0x000004dc, len = 4946
+ 7. 'head' - checksum = 0xe43df9fb, offset = 0x000000ec, len = 54
+ 8. 'hhea' - checksum = 0x05e9014f, offset = 0x00000124, len = 36
+ 9. 'hmtx' - checksum = 0x4ca30981, offset = 0x000001c0, len = 202
+ 10. 'loca' - checksum = 0x6c437107, offset = 0x00000474, len = 104
+ 11. 'maxp' - checksum = 0x0079007b, offset = 0x00000148, len = 32
+ 12. 'name' - checksum = 0x31984665, offset = 0x00001830, len = 1002
+ 13. 'post' - checksum = 0x0aef76ec, offset = 0x00001c1c, len = 140
+
+'GPOS' Table - Glyph Positioning Data
+-------------------------------------
+ 'GPOS' Version: 1.0
+ scriptCount: 1
+ 0. 'latn' script - langSysCount: 0
+ default lang - featureCount: 1
+ featureIndex: 0
+
+ featureCount: 1
+ 0. 'kern' feature - lookupCount: 1
+ lookupListIndex: 0
+
+ lookupCount: 1
+ 0. lookupType: 2, lookupFlag: 0x0000
+ subTableCount: 1
+ 0. lookupFormat: 1 - Pair Adjustment List
+ Coverage - glyphCount: 1
+ glyphArray: 34
+ valueFormat1: 0x0004, valueFormat2: 0x0000, pairSetCount: 1
+ 0. pairValueCount: 1
+ 0. secondGlyph: 14
+ value1: XAdvance = -33
+
diff --git a/Build/source/texk/ttfdump/tests/ttfdump.gsub b/Build/source/texk/ttfdump/tests/ttfdump.gsub
new file mode 100644
index 00000000000..574556947f6
--- /dev/null
+++ b/Build/source/texk/ttfdump/tests/ttfdump.gsub
@@ -0,0 +1,35 @@
+True Type Font File Dumper: v 0.5.5
+Copyright 1996-1998 ollie@ms1.hinet.net
+Dumping File:FonetikaDaniaIwonaeRegular.ttf
+
+
+Offset Table
+------------
+ sfnt version: 1.0
+ number of tables: 14
+ 0. 'GPOS' - checksum = 0xd7f8e75c, offset = 0x00001cd0, len = 80
+ 1. 'GSUB' - checksum = 0x6c91748f, offset = 0x00001cb0, len = 32
+ 2. 'OS/2' - checksum = 0x55d6fec3, offset = 0x00000168, len = 86
+ 3. 'cmap' - checksum = 0x987c2758, offset = 0x0000028c, len = 482
+ 4. 'cvt ' - checksum = 0x00210279, offset = 0x00000470, len = 4
+ 5. 'gasp' - checksum = 0xffff0003, offset = 0x00001ca8, len = 8
+ 6. 'glyf' - checksum = 0xd071d50c, offset = 0x000004dc, len = 4946
+ 7. 'head' - checksum = 0xe43df9fb, offset = 0x000000ec, len = 54
+ 8. 'hhea' - checksum = 0x05e9014f, offset = 0x00000124, len = 36
+ 9. 'hmtx' - checksum = 0x4ca30981, offset = 0x000001c0, len = 202
+ 10. 'loca' - checksum = 0x6c437107, offset = 0x00000474, len = 104
+ 11. 'maxp' - checksum = 0x0079007b, offset = 0x00000148, len = 32
+ 12. 'name' - checksum = 0x31984665, offset = 0x00001830, len = 1002
+ 13. 'post' - checksum = 0x0aef76ec, offset = 0x00001c1c, len = 140
+
+'GSUB' Table - Glyph Substitution Data
+--------------------------------------
+ 'GSUB' Version: 1.0
+ scriptCount: 1
+ 0. 'latn' script - langSysCount: 0
+ default lang - featureCount: 0
+
+ featureCount: 0
+
+ lookupCount: 0
+
diff --git a/Build/source/texk/ttfdump/tests/ttfdump.head b/Build/source/texk/ttfdump/tests/ttfdump.head
index 4e626afd6f1..d960f69b4c2 100644
--- a/Build/source/texk/ttfdump/tests/ttfdump.head
+++ b/Build/source/texk/ttfdump/tests/ttfdump.head
@@ -1,37 +1,37 @@
True Type Font File Dumper: v 0.5.5
-Copyright 1996-1998 ollie@ms1.hinet.net
+Copyright 1996-1998 ollie@ms1.hinet.net
Dumping File:FonetikaDaniaIwonaeRegular.ttf
-Offset Table
-------------
- sfnt version:
+Offset Table
+------------
+ sfnt version: 1.0
number of tables: 14
- 0. 'GPOS' - checksum = 0xd7f8e75c, offset = 0x00001cd0, len = 80
- 1. 'GSUB' - checksum = 0x6c91748f, offset = 0x00001cb0, len = 32
- 2. 'OS/2' - checksum = 0x55d6fec3, offset = 0x00000168, len = 86
- 3. 'cmap' - checksum = 0x987c2758, offset = 0x0000028c, len = 482
- 4. 'cvt ' - checksum = 0x00210279, offset = 0x00000470, len = 4
- 5. 'gasp' - checksum = 0xffff0003, offset = 0x00001ca8, len = 8
- 6. 'glyf' - checksum = 0xd071d50c, offset = 0x000004dc, len = 4946
- 7. 'head' - checksum = 0xe43df9fb, offset = 0x000000ec, len = 54
- 8. 'hhea' - checksum = 0x05e9014f, offset = 0x00000124, len = 36
- 9. 'hmtx' - checksum = 0x4ca30981, offset = 0x000001c0, len = 202
- 10. 'loca' - checksum = 0x6c437107, offset = 0x00000474, len = 104
- 11. 'maxp' - checksum = 0x0079007b, offset = 0x00000148, len = 32
- 12. 'name' - checksum = 0x31984665, offset = 0x00001830, len = 1002
- 13. 'post' - checksum = 0x0aef76ec, offset = 0x00001c1c, len = 140
+ 0. 'GPOS' - checksum = 0xd7f8e75c, offset = 0x00001cd0, len = 80
+ 1. 'GSUB' - checksum = 0x6c91748f, offset = 0x00001cb0, len = 32
+ 2. 'OS/2' - checksum = 0x55d6fec3, offset = 0x00000168, len = 86
+ 3. 'cmap' - checksum = 0x987c2758, offset = 0x0000028c, len = 482
+ 4. 'cvt ' - checksum = 0x00210279, offset = 0x00000470, len = 4
+ 5. 'gasp' - checksum = 0xffff0003, offset = 0x00001ca8, len = 8
+ 6. 'glyf' - checksum = 0xd071d50c, offset = 0x000004dc, len = 4946
+ 7. 'head' - checksum = 0xe43df9fb, offset = 0x000000ec, len = 54
+ 8. 'hhea' - checksum = 0x05e9014f, offset = 0x00000124, len = 36
+ 9. 'hmtx' - checksum = 0x4ca30981, offset = 0x000001c0, len = 202
+ 10. 'loca' - checksum = 0x6c437107, offset = 0x00000474, len = 104
+ 11. 'maxp' - checksum = 0x0079007b, offset = 0x00000148, len = 32
+ 12. 'name' - checksum = 0x31984665, offset = 0x00001830, len = 1002
+ 13. 'post' - checksum = 0x0aef76ec, offset = 0x00001c1c, len = 140
'head' Table - Font Header
--------------------------
- 'head' version: 1. 0
- fontReversion: 1. 0
+ 'head' version: 1.0
+ fontReversion: 1.0
checkSumAdjustment: 0x851d4906
magicNumber: 0x5f0f3cf5
flags: 0x000b
unitsPerEm: 1000
- created:
- modified:
+ created: 0x00000000c1405b91
+ modified: 0x00000000c1405b91
xMin: -63
yMin: -250
xMax: 733
diff --git a/Build/source/texk/ttfdump/tests/ttfdump.test b/Build/source/texk/ttfdump/tests/ttfdump.test
index deddc589804..0196bea97a1 100755
--- a/Build/source/texk/ttfdump/tests/ttfdump.test
+++ b/Build/source/texk/ttfdump/tests/ttfdump.test
@@ -3,12 +3,32 @@
# Copyright (C) 2011 Peter Breitenlohner <tex-live@tug.org>
# You may freely use, modify and/or distribute this file.
-rm -rf FonetikaDaniaIwonaeRegular.ttf ttfdump.glyf ttfdump.head
+failed=
+
+rm -rf FonetikaDaniaIwonaeRegular.ttf ttftest.*
cp $srcdir/tests/FonetikaDaniaIwonaeRegular.ttf .
-./ttfdump -t head -o ttfdump.head FonetikaDaniaIwonaeRegular.ttf || exit 1
-diff -b $srcdir/tests/ttfdump.head ttfdump.head || exit 1
+./ttfdump -t glyf -g 1 -o ttftest.glyf FonetikaDaniaIwonaeRegular.ttf \
+ && diff -b $srcdir/tests/ttfdump.glyf ttftest.glyf \
+ && echo "ttfdump.glyf tests OK" \
+ || failed="$failed ttfdump.glyf"
+
+./ttfdump -t GPOS -o ttftest.gpos FonetikaDaniaIwonaeRegular.ttf \
+ && diff -b $srcdir/tests/ttfdump.gpos ttftest.gpos \
+ && echo "ttfdump.gpos tests OK" \
+ || failed="$failed ttfdump.gpos"
+
+./ttfdump -t GSUB -o ttftest.gsub FonetikaDaniaIwonaeRegular.ttf \
+ && diff -b $srcdir/tests/ttfdump.gsub ttftest.gsub \
+ && echo "ttfdump.gsub tests OK" \
+ || failed="$failed ttfdump.gsub"
+
+./ttfdump -t head -o ttftest.head FonetikaDaniaIwonaeRegular.ttf \
+ && diff -b $srcdir/tests/ttfdump.head ttftest.head \
+ && echo "ttfdump.head tests OK" \
+ || failed="$failed ttfdump.head"
-./ttfdump -t glyf -g 1 -o ttfdump.glyf FonetikaDaniaIwonaeRegular.ttf || exit 1
-diff -b $srcdir/tests/ttfdump.glyf ttfdump.glyf || exit 1
+test -z "$failed" && exit 0
+echo "failed tests:$failed"
+exit 1