summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2013-08-06 09:35:47 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2013-08-06 09:35:47 +0000
commit23efce276c60a5a2f3b2f1decb9a17fc894df597 (patch)
treefdec83e95c9907b2359f6453c4c165f43217533e
parent34f0ce7203836a8959ceb4ebd1e3842832cdb1d7 (diff)
pdftex: Add a test for ttf2afm with invalid 'post' table version
git-svn-id: svn://tug.org/texlive/trunk@31362 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/web2c/Makefile.in16
-rw-r--r--Build/source/texk/web2c/pdftexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/pdftexdir/am/ttf2afm.am17
-rw-r--r--Build/source/texk/web2c/pdftexdir/tests/postV3.afm69
-rw-r--r--Build/source/texk/web2c/pdftexdir/tests/postV3.ttfbin0 -> 7456 bytes
-rw-r--r--Build/source/texk/web2c/pdftexdir/tests/postV7.afm69
-rw-r--r--Build/source/texk/web2c/pdftexdir/tests/postV7.ttfbin0 -> 7456 bytes
-rwxr-xr-xBuild/source/texk/web2c/pdftexdir/ttf2afm.test33
8 files changed, 202 insertions, 7 deletions
diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in
index d8343eb0dd3..1c056e49471 100644
--- a/Build/source/texk/web2c/Makefile.in
+++ b/Build/source/texk/web2c/Makefile.in
@@ -208,7 +208,8 @@ DIST_COMMON = $(srcdir)/am/bootstrap.am $(srcdir)/am/web.am \
@MINGW32_TRUE@ pdftexdir/regex/regex.h
@PDFTEX_TRUE@am__append_57 = pdftex ttf2afm pdftosrc
-@PDFTEX_TRUE@am__append_58 = $(pdftex_tests) $(pdftosrc_tests)
+@PDFTEX_TRUE@am__append_58 = $(pdftex_tests) $(ttf2afm_tests) \
+@PDFTEX_TRUE@ $(pdftosrc_tests)
@LUATEX_TRUE@am__append_59 = luatex
@LUATEX_TRUE@@WIN32_TRUE@am__append_60 = call_luatex
@LUATEX_TRUE@@WIN32_TRUE@am__append_61 = install-luatex-links
@@ -1812,9 +1813,11 @@ EXTRA_DIST = PROJECTS cftests cpascal.h help.h w2c/config.h \
pdftexdir/README pdftexdir/change-files.txt $(pdftex_tests) \
tests/wprob.tex pdftexdir/tests/pdfimage.tex tests/1-4.jpg \
tests/B.pdf tests/basic.tex tests/lily-ledger-broken.png \
- $(pdftosrc_tests) pdftexdir/tests/test-13.pdf \
- pdftexdir/tests/test-13.xref pdftexdir/tests/test-15.pdf \
- pdftexdir/tests/test-15.xref \
+ $(ttf2afm_tests) pdftexdir/tests/postV3.afm \
+ pdftexdir/tests/postV3.ttf pdftexdir/tests/postV7.afm \
+ pdftexdir/tests/postV7.ttf $(pdftosrc_tests) \
+ pdftexdir/tests/test-13.pdf pdftexdir/tests/test-13.xref \
+ pdftexdir/tests/test-15.pdf pdftexdir/tests/test-15.xref \
luatexdir/luasocket/src/socket_lua.c \
luatexdir/luasocket/src/ftp_lua.c \
luatexdir/luasocket/src/headers_lua.c \
@@ -1999,8 +2002,8 @@ DISTCLEANFILES = $(EXTRA_LIBRARIES) CXXLD.sh tangle.c tangle.h \
euptex.web euptex.ch euptex-web2c euptex.p euptex.pool \
euptex-tangle euptrip.diffs $(nodist_pdftex_SOURCES) pdftex.ch \
pdftex-web2c pdftex.p pdftex.pool pdftex-tangle pwprob.log \
- pwprob.tex pdfimage.fmt pdfimage.log pdfimage.pdf test-13.pdf \
- test-13.xref test-15.pdf test-15.xref \
+ pwprob.tex pdfimage.fmt pdfimage.log pdfimage.pdf postV3.afm \
+ postV7.afm test-13.pdf test-13.xref test-15.pdf test-15.xref \
$(nodist_libluatex_a_SOURCES) luaimage.fmt luaimage.log \
luaimage.pdf txt2zlib.c $(nodist_xetex_SOURCES) xetex.web \
xetex.ch xetex-web2c xetex.p xetex.pool xetex-tangle \
@@ -2506,6 +2509,7 @@ ttf2afm_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/pdftexdir
ttf2afm_SOURCES = pdftexdir/ttf2afm.c
ttf2afm_DEPENDENCIES = $(default_dependencies)
EXTRA_ttf2afm_SOURCES = pdftexdir/macnames.c
+ttf2afm_tests = pdftexdir/ttf2afm.test
# Force Automake to use CXXLD for linking
nodist_EXTRA_pdftosrc_SOURCES = dummy.cxx
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog
index daf06b71a2c..c8536eb3a5f 100644
--- a/Build/source/texk/web2c/pdftexdir/ChangeLog
+++ b/Build/source/texk/web2c/pdftexdir/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-02 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * ttf2afm.test, tests/postV[37].{afm.ttf}: New test and data.
+ * am/ttf2afm.am: Add the new test.
+
2013-07-30 Peter Breitenlohner <peb@mppmu.mpg.de>
* ttf2afm.c, writettf.c: Treat unknown 'post' table versions
diff --git a/Build/source/texk/web2c/pdftexdir/am/ttf2afm.am b/Build/source/texk/web2c/pdftexdir/am/ttf2afm.am
index 318c5fd90a9..075b6088870 100644
--- a/Build/source/texk/web2c/pdftexdir/am/ttf2afm.am
+++ b/Build/source/texk/web2c/pdftexdir/am/ttf2afm.am
@@ -1,6 +1,6 @@
## texk/web2c/pdftexdir/am/ttf2afm.am: Makefile fragment for ttf2afm.
##
-## Copyright (C) 2009 - 2011 Peter Breitenlohner <tex-live@tug.org>
+## Copyright (C) 2009-2013 Peter Breitenlohner <tex-live@tug.org>
## You may freely use, modify and/or distribute this file.
## ttf2afm
@@ -18,3 +18,18 @@ ttf2afm_DEPENDENCIES = $(default_dependencies)
## included by pdftexdir/ttf2afm.c
EXTRA_ttf2afm_SOURCES = pdftexdir/macnames.c
+
+## Tests
+##
+ttf2afm_tests = pdftexdir/ttf2afm.test
+EXTRA_DIST += $(ttf2afm_tests)
+
+## pdftexdir/ttf1afm.test
+EXTRA_DIST += pdftexdir/tests/postV3.afm pdftexdir/tests/postV3.ttf
+EXTRA_DIST += pdftexdir/tests/postV7.afm pdftexdir/tests/postV7.ttf
+DISTCLEANFILES += postV3.afm postV7.afm
+
+if PDFTEX
+TESTS += $(ttf2afm_tests)
+endif PDFTEX
+
diff --git a/Build/source/texk/web2c/pdftexdir/tests/postV3.afm b/Build/source/texk/web2c/pdftexdir/tests/postV3.afm
new file mode 100644
index 00000000000..1ca0acb0fbf
--- /dev/null
+++ b/Build/source/texk/web2c/pdftexdir/tests/postV3.afm
@@ -0,0 +1,69 @@
+StartFontMetrics 2.0
+FontName FonetikaDaniaIwonaeRegular
+FullName Fonetika Dania Iwonae Regular
+FamilyName FonetikaDaniaIwonae
+Weight Normal
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -63 -250 733 750
+UnderlinePosition -100
+UnderlineThickness 50
+Version Version 001.000
+Notice Created by Palle J¿rgensen, with FontForge 1.0 (http://fontforge.sf.net)\nThe license is GUST Font Nosource License.
+EncodingScheme FontSpecific
+Ascender 750
+Descender -250
+StartCharMetrics 51
+C -1 ; WX 432 ; N .notdef ; B 33 0 366 666 ;
+C -1 ; WX 0 ; N .null ; B 108 471 286 700 ;
+C -1 ; WX 333 ; N CR ; B 108 471 286 700 ;
+C -1 ; WX 222 ; N quoteright ; B 108 471 286 700 ;
+C -1 ; WX 278 ; N comma ; B 108 -229 170 121 ;
+C -1 ; WX 278 ; N period ; B 90 362 188 460 ;
+C -1 ; WX 295 ; N zero ; B 19 -158 261 162 ;
+C -1 ; WX 491 ; N A ; B 62 -10 541 460 ;
+C -1 ; WX 591 ; N B ; B 62 -10 733 649 ;
+C -1 ; WX 442 ; N C ; B 71 -10 467 655 ;
+C -1 ; WX 460 ; N D ; B 54 -10 540 700 ;
+C -1 ; WX 438 ; N E ; B 62 -10 434 460 ;
+C -1 ; WX 249 ; N I ; B 13 -240 278 661 ;
+C -1 ; WX 455 ; N N ; B 43 -163 447 460 ;
+C -1 ; WX 307 ; N R ; B -15 0 307 457 ;
+C -1 ; WX 382 ; N S ; B 13 -240 394 460 ;
+C -1 ; WX 222 ; N bracketleft ; B 34 -250 188 750 ;
+C -1 ; WX 222 ; N bracketright ; B 34 -250 188 750 ;
+C -1 ; WX 462 ; N a ; B 57 -10 472 460 ;
+C -1 ; WX 462 ; N b ; B 43 -10 458 700 ;
+C -1 ; WX 442 ; N c ; B 71 -10 431 460 ;
+C -1 ; WX 462 ; N d ; B 57 -10 526 700 ;
+C -1 ; WX 438 ; N e ; B 62 -10 434 460 ;
+C -1 ; WX 243 ; N f ; B 51 0 399 710 ;
+C -1 ; WX 462 ; N g ; B 51 -240 472 460 ;
+C -1 ; WX 455 ; N h ; B 43 0 447 700 ;
+C -1 ; WX 249 ; N i ; B 58 -10 274 661 ;
+C -1 ; WX 224 ; N j ; B -63 -240 279 661 ;
+C -1 ; WX 426 ; N k ; B 43 0 483 700 ;
+C -1 ; WX 253 ; N l ; B 62 -10 288 700 ;
+C -1 ; WX 612 ; N m ; B 43 0 605 460 ;
+C -1 ; WX 455 ; N n ; B 43 0 447 460 ;
+C -1 ; WX 442 ; N o ; B 60 -10 436 460 ;
+C -1 ; WX 458 ; N p ; B -10 -230 454 460 ;
+C -1 ; WX 307 ; N r ; B 43 0 365 457 ;
+C -1 ; WX 382 ; N s ; B 13 -10 394 460 ;
+C -1 ; WX 271 ; N t ; B 86 -10 321 600 ;
+C -1 ; WX 455 ; N u ; B 61 -10 465 450 ;
+C -1 ; WX 370 ; N v ; B 82 0 436 450 ;
+C -1 ; WX 568 ; N w ; B 90 0 627 450 ;
+C -1 ; WX 455 ; N y ; B 61 -240 465 450 ;
+C -1 ; WX 278 ; N bar ; B 108 400 170 750 ;
+C -1 ; WX 455 ; N eng ; B 43 -163 447 460 ;
+C -1 ; WX 462 ; N Aring ; B 47 -10 442 685 ;
+C -1 ; WX 462 ; N AE ; B 57 -10 472 661 ;
+C -1 ; WX 442 ; N Oslash ; B 60 -10 467 655 ;
+C -1 ; WX 462 ; N aring ; B 57 -10 472 685 ;
+C -1 ; WX 690 ; N ae ; B 49 -10 686 460 ;
+C -1 ; WX 460 ; N eth ; B 54 -10 540 700 ;
+C -1 ; WX 442 ; N odieresis ; B 60 -10 467 655 ;
+C -1 ; WX 442 ; N oslash ; B 13 -47 482 497 ;
+EndCharMetrics
+EndFontMetrics
diff --git a/Build/source/texk/web2c/pdftexdir/tests/postV3.ttf b/Build/source/texk/web2c/pdftexdir/tests/postV3.ttf
new file mode 100644
index 00000000000..95e09e4eb9f
--- /dev/null
+++ b/Build/source/texk/web2c/pdftexdir/tests/postV3.ttf
Binary files differ
diff --git a/Build/source/texk/web2c/pdftexdir/tests/postV7.afm b/Build/source/texk/web2c/pdftexdir/tests/postV7.afm
new file mode 100644
index 00000000000..ec5d1a9391f
--- /dev/null
+++ b/Build/source/texk/web2c/pdftexdir/tests/postV7.afm
@@ -0,0 +1,69 @@
+StartFontMetrics 2.0
+FontName FonetikaDaniaIwonaeRegular
+FullName Fonetika Dania Iwonae Regular
+FamilyName FonetikaDaniaIwonae
+Weight Normal
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -63 -250 733 750
+UnderlinePosition -100
+UnderlineThickness 50
+Version Version 001.000
+Notice Created by Palle J¿rgensen, with FontForge 1.0 (http://fontforge.sf.net)\nThe license is GUST Font Nosource License.
+EncodingScheme FontSpecific
+Ascender 750
+Descender -250
+StartCharMetrics 51
+C -1 ; WX 432 ; N index0 ; B 33 0 366 666 ;
+C -1 ; WX 0 ; N index1 ; B 108 471 286 700 ;
+C -1 ; WX 333 ; N index2 ; B 108 471 286 700 ;
+C -1 ; WX 222 ; N index3 ; B 108 471 286 700 ;
+C -1 ; WX 278 ; N index4 ; B 108 -229 170 121 ;
+C -1 ; WX 278 ; N index5 ; B 90 362 188 460 ;
+C -1 ; WX 295 ; N index6 ; B 19 -158 261 162 ;
+C -1 ; WX 491 ; N index7 ; B 62 -10 541 460 ;
+C -1 ; WX 591 ; N index8 ; B 62 -10 733 649 ;
+C -1 ; WX 442 ; N index9 ; B 71 -10 467 655 ;
+C -1 ; WX 460 ; N index10 ; B 54 -10 540 700 ;
+C -1 ; WX 438 ; N index11 ; B 62 -10 434 460 ;
+C -1 ; WX 249 ; N index12 ; B 13 -240 278 661 ;
+C -1 ; WX 455 ; N index13 ; B 43 -163 447 460 ;
+C -1 ; WX 307 ; N index14 ; B -15 0 307 457 ;
+C -1 ; WX 382 ; N index15 ; B 13 -240 394 460 ;
+C -1 ; WX 222 ; N index16 ; B 34 -250 188 750 ;
+C -1 ; WX 222 ; N index17 ; B 34 -250 188 750 ;
+C -1 ; WX 462 ; N index18 ; B 57 -10 472 460 ;
+C -1 ; WX 462 ; N index19 ; B 43 -10 458 700 ;
+C -1 ; WX 442 ; N index20 ; B 71 -10 431 460 ;
+C -1 ; WX 462 ; N index21 ; B 57 -10 526 700 ;
+C -1 ; WX 438 ; N index22 ; B 62 -10 434 460 ;
+C -1 ; WX 243 ; N index23 ; B 51 0 399 710 ;
+C -1 ; WX 462 ; N index24 ; B 51 -240 472 460 ;
+C -1 ; WX 455 ; N index25 ; B 43 0 447 700 ;
+C -1 ; WX 249 ; N index26 ; B 58 -10 274 661 ;
+C -1 ; WX 224 ; N index27 ; B -63 -240 279 661 ;
+C -1 ; WX 426 ; N index28 ; B 43 0 483 700 ;
+C -1 ; WX 253 ; N index29 ; B 62 -10 288 700 ;
+C -1 ; WX 612 ; N index30 ; B 43 0 605 460 ;
+C -1 ; WX 455 ; N index31 ; B 43 0 447 460 ;
+C -1 ; WX 442 ; N index32 ; B 60 -10 436 460 ;
+C -1 ; WX 458 ; N index33 ; B -10 -230 454 460 ;
+C -1 ; WX 307 ; N index34 ; B 43 0 365 457 ;
+C -1 ; WX 382 ; N index35 ; B 13 -10 394 460 ;
+C -1 ; WX 271 ; N index36 ; B 86 -10 321 600 ;
+C -1 ; WX 455 ; N index37 ; B 61 -10 465 450 ;
+C -1 ; WX 370 ; N index38 ; B 82 0 436 450 ;
+C -1 ; WX 568 ; N index39 ; B 90 0 627 450 ;
+C -1 ; WX 455 ; N index40 ; B 61 -240 465 450 ;
+C -1 ; WX 278 ; N index41 ; B 108 400 170 750 ;
+C -1 ; WX 455 ; N index42 ; B 43 -163 447 460 ;
+C -1 ; WX 462 ; N index43 ; B 47 -10 442 685 ;
+C -1 ; WX 462 ; N index44 ; B 57 -10 472 661 ;
+C -1 ; WX 442 ; N index45 ; B 60 -10 467 655 ;
+C -1 ; WX 462 ; N index46 ; B 57 -10 472 685 ;
+C -1 ; WX 690 ; N index47 ; B 49 -10 686 460 ;
+C -1 ; WX 460 ; N index48 ; B 54 -10 540 700 ;
+C -1 ; WX 442 ; N index49 ; B 60 -10 467 655 ;
+C -1 ; WX 442 ; N index50 ; B 13 -47 482 497 ;
+EndCharMetrics
+EndFontMetrics
diff --git a/Build/source/texk/web2c/pdftexdir/tests/postV7.ttf b/Build/source/texk/web2c/pdftexdir/tests/postV7.ttf
new file mode 100644
index 00000000000..7f298cfd037
--- /dev/null
+++ b/Build/source/texk/web2c/pdftexdir/tests/postV7.ttf
Binary files differ
diff --git a/Build/source/texk/web2c/pdftexdir/ttf2afm.test b/Build/source/texk/web2c/pdftexdir/ttf2afm.test
new file mode 100755
index 00000000000..2820dee2c8d
--- /dev/null
+++ b/Build/source/texk/web2c/pdftexdir/ttf2afm.test
@@ -0,0 +1,33 @@
+#! /bin/sh
+#
+# Copyright (C) 2013 Peter Breitenlohner <tex-live@tug.org>
+# You may freely use, modify and/or distribute this file.
+
+TEXMFCNF=$srcdir/../kpathsea
+TEXINPUTS=$srcdir/pdftexdir/tests:$srcdir/tests
+TEXFONTS=$srcdir/pdftexdir/tests
+export TEXMFCNF TEXINPUTS TEXFONTS
+
+testsrc=$srcdir/pdftexdir/tests
+
+failed=
+
+echo "*** ttf2afm postV3.ttf" \
+ && ./ttf2afm postV3.ttf \
+ | sed '/Converted at/d' >postV3.afm \
+ && diff $testsrc/postV3.afm postV3.afm \
+ && echo && echo "postV3 tests OK" && echo \
+ || failed="$failed postV3"
+
+echo "*** ttf2afm postV7.ttf" \
+ && ./ttf2afm postV7.ttf \
+ | sed '/Converted at/d' >postV7.afm \
+ && diff $testsrc/postV7.afm postV7.afm \
+ && echo && echo "postV7 tests OK" && echo \
+ || failed="$failed postV7"
+
+test -z "$failed" && exit 0
+echo
+echo "failed tests:$failed"
+exit 1
+