summaryrefslogtreecommitdiff
path: root/systems/doc/pdftex/tests
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /systems/doc/pdftex/tests
Initial commit
Diffstat (limited to 'systems/doc/pdftex/tests')
-rw-r--r--systems/doc/pdftex/tests/01-fake-interword-space/Makefile7
-rw-r--r--systems/doc/pdftex/tests/01-fake-interword-space/dummy-space.pfbbin0 -> 2409 bytes
-rw-r--r--systems/doc/pdftex/tests/01-fake-interword-space/dummy-space.tfmbin0 -> 152 bytes
-rw-r--r--systems/doc/pdftex/tests/01-fake-interword-space/fake-interword-space.tex34
-rw-r--r--systems/doc/pdftex/tests/02-pdfmatch/Makefile10
-rw-r--r--systems/doc/pdftex/tests/02-pdfmatch/test-pdfmatch.tex22
-rw-r--r--systems/doc/pdftex/tests/03-deterministic-output/Makefile48
-rw-r--r--systems/doc/pdftex/tests/03-deterministic-output/test-SOURCE_DATE_EPOCH.tex10
-rw-r--r--systems/doc/pdftex/tests/03-deterministic-output/test-fixed-date-id.tex16
-rw-r--r--systems/doc/pdftex/tests/03-deterministic-output/test-no-date-id.tex13
-rw-r--r--systems/doc/pdftex/tests/03-deterministic-output/test-prim.tex11
-rw-r--r--systems/doc/pdftex/tests/04-pdfsuppressptexinfo/Makefile40
-rw-r--r--systems/doc/pdftex/tests/04-pdfsuppressptexinfo/abc.tex10
-rw-r--r--systems/doc/pdftex/tests/04-pdfsuppressptexinfo/test-pdfinfoomitdate.tex4
-rw-r--r--systems/doc/pdftex/tests/04-pdfsuppressptexinfo/test-pdfsuppressptexinfo.tex18
-rw-r--r--systems/doc/pdftex/tests/04-pdfsuppressptexinfo/test-pdftrailer.tex6
-rw-r--r--systems/doc/pdftex/tests/05-mediabox/Makefile18
-rw-r--r--systems/doc/pdftex/tests/05-mediabox/test-normal.tex7
-rw-r--r--systems/doc/pdftex/tests/05-mediabox/test-omit-mediabox.tex8
-rw-r--r--systems/doc/pdftex/tests/06-pkmap/Makefile24
-rw-r--r--systems/doc/pdftex/tests/06-pkmap/cmb10.72pkbin0 -> 1952 bytes
-rw-r--r--systems/doc/pdftex/tests/06-pkmap/cmr10.72pkbin0 -> 1940 bytes
-rw-r--r--systems/doc/pdftex/tests/06-pkmap/prepatch.pdfbin0 -> 3045 bytes
-rw-r--r--systems/doc/pdftex/tests/06-pkmap/test-pkmap.tex37
-rw-r--r--systems/doc/pdftex/tests/07-mapwarn/Makefile12
-rw-r--r--systems/doc/pdftex/tests/07-mapwarn/test-mapwarn.tex18
-rw-r--r--systems/doc/pdftex/tests/Common.mak34
27 files changed, 407 insertions, 0 deletions
diff --git a/systems/doc/pdftex/tests/01-fake-interword-space/Makefile b/systems/doc/pdftex/tests/01-fake-interword-space/Makefile
new file mode 100644
index 0000000000..f565355eab
--- /dev/null
+++ b/systems/doc/pdftex/tests/01-fake-interword-space/Makefile
@@ -0,0 +1,7 @@
+# Public domain.
+
+test:
+ ../../source/build-pdftex/texk/web2c/pdftex -ini fake-interword-space.tex
+
+clean:
+ $(clean)
diff --git a/systems/doc/pdftex/tests/01-fake-interword-space/dummy-space.pfb b/systems/doc/pdftex/tests/01-fake-interword-space/dummy-space.pfb
new file mode 100644
index 0000000000..46390162be
--- /dev/null
+++ b/systems/doc/pdftex/tests/01-fake-interword-space/dummy-space.pfb
Binary files differ
diff --git a/systems/doc/pdftex/tests/01-fake-interword-space/dummy-space.tfm b/systems/doc/pdftex/tests/01-fake-interword-space/dummy-space.tfm
new file mode 100644
index 0000000000..fc0719e1a5
--- /dev/null
+++ b/systems/doc/pdftex/tests/01-fake-interword-space/dummy-space.tfm
Binary files differ
diff --git a/systems/doc/pdftex/tests/01-fake-interword-space/fake-interword-space.tex b/systems/doc/pdftex/tests/01-fake-interword-space/fake-interword-space.tex
new file mode 100644
index 0000000000..09d7bff39f
--- /dev/null
+++ b/systems/doc/pdftex/tests/01-fake-interword-space/fake-interword-space.tex
@@ -0,0 +1,34 @@
+\input plain.tex
+\input pdftexconfig.tex
+\input pdftexmagfix.tex
+
+\pdfmapline{+dummy-space <dummy-space.pfb}
+\pdfglyphtounicode{space}{0020}
+\pdfcompresslevel=0
+\pdfobjcompresslevel=0
+
+Text with no interword spaces.
+
+\pdfinterwordspaceon
+
+Switch to text with faked interword spaces.
+
+\pdfinterwordspaceoff
+
+Back to text with no interword \pdffakespace spaces.
+
+% Test of \pdffakespace in vertical mode
+\pdffakespace
+
+% Test of \pdffakespace in math mode
+$a\pdffakespace b$
+
+Back to text with no interword \pdffakespace\pdffakespace spaces.
+
+% Test of \pdffakespace in vertical mode
+\pdffakespace
+\pdffakespace
+
+% Test of \pdffakespace in math mode
+$a\pdffakespace \pdffakespace b$
+\bye
diff --git a/systems/doc/pdftex/tests/02-pdfmatch/Makefile b/systems/doc/pdftex/tests/02-pdfmatch/Makefile
new file mode 100644
index 0000000000..06943375d0
--- /dev/null
+++ b/systems/doc/pdftex/tests/02-pdfmatch/Makefile
@@ -0,0 +1,10 @@
+# $Id: Makefile 758 2016-06-12 16:54:10Z karl $
+# Public domain.
+
+include ../Common.mak
+
+testpdfmatch:
+ $(prog) test-pdfmatch.tex
+
+clean:
+ $(clean)
diff --git a/systems/doc/pdftex/tests/02-pdfmatch/test-pdfmatch.tex b/systems/doc/pdftex/tests/02-pdfmatch/test-pdfmatch.tex
new file mode 100644
index 0000000000..f6d55fe587
--- /dev/null
+++ b/systems/doc/pdftex/tests/02-pdfmatch/test-pdfmatch.tex
@@ -0,0 +1,22 @@
+% $Id: test-pdfmatch.tex 759 2016-06-12 18:11:28Z karl $
+% This file public domain. Bug report of \pdflastmatch crash:
+% http://tug.org/pipermail/tex-live/2016-June/038664.html
+%
+\catcode`\{=1 \catcode`\}=2 \catcode`^=7 \newlinechar=`^^J
+%
+\message{^^Jpdflastmatch0 before any match: \pdflastmatch0}
+\message{^^J}%
+%
+\message{^^Jmatch a to b: \pdfmatch{a}{b}}
+\message{^^J}%
+\message{pdflastmatch0: \pdflastmatch0}
+\message{^^J}%
+%
+\message{^^Jmatch example: \pdfmatch subcount 3 {ab(cd)*ef(gh)(ij)}{abefghij}}
+\message{^^J}%
+\message{pdflastmatch0 (0->abefghij): \pdflastmatch0 ^^J}
+\message{pdflastmatch1 (-1->): \pdflastmatch1 ^^J}
+\message{pdflastmatch2 (4->gh): \pdflastmatch2 ^^J}
+\message{pdflastmatch3 (-1->): \pdflastmatch3}
+\message{^^J}%
+\end
diff --git a/systems/doc/pdftex/tests/03-deterministic-output/Makefile b/systems/doc/pdftex/tests/03-deterministic-output/Makefile
new file mode 100644
index 0000000000..0f7177f77e
--- /dev/null
+++ b/systems/doc/pdftex/tests/03-deterministic-output/Makefile
@@ -0,0 +1,48 @@
+# $Id: Makefile 772 2017-03-16 22:58:04Z karl $
+# Public domain.
+
+include ../Common.mak
+
+test1:
+ $(prog) test-no-date-id.tex
+
+test2:
+ $(prog) test-fixed-date-id.tex
+
+testprim:
+ SOURCE_DATE_EPOCH=120 FORCE_SOURCE_DATE=1 \
+ $(prog) test-prim.tex
+
+test = test-SOURCE_DATE_EPOCH
+# test invalid settings of the envvar.
+test3-invalid:
+ -SOURCE_DATE_EPOCH=" " $(prog) $(test).tex
+ -SOURCE_DATE_EPOCH=abc123 $(prog) $(test).tex
+ -SOURCE_DATE_EPOCH=0.0 $(prog) $(test).tex
+ -SOURCE_DATE_EPOCH=-1 $(prog) $(test).tex
+ -SOURCE_DATE_EPOCH=123abc $(prog) $(test).tex
+ -SOURCE_DATE_EPOCH=994399281551439928155 $(prog) $(test).tex
+
+test3-orig.pdf:
+ $(prog) $(test).tex && mv $(test).pdf $@
+
+# test valid settings of the envvar.
+test3-valid: test3-orig.pdf test3-repro.pdf
+ SOURCE_DATE_EPOCH=0 $(prog) $(test).tex
+ SOURCE_DATE_EPOCH="" $(prog) $(test).tex # same as 0
+ -$(diff) $< $(test).pdf # shows differences
+ SOURCE_DATE_EPOCH=11 $(prog) $(test).tex
+ $(diff) test3-repro.pdf $(test).pdf # should be identical
+# SOURCE_DATE_EPOCH=1439928155 $(prog) $(test).tex
+
+# make an original with nonzero time for checking.
+test3-repro.pdf: force
+ SOURCE_DATE_EPOCH=11 $(prog) $(test).tex && mv $(test).pdf $@
+force:
+
+clean:
+ $(clean)
+
+fmt:
+ $(prog) \*pdflatex.ini
+ $(prog) \*pdfetex.ini
diff --git a/systems/doc/pdftex/tests/03-deterministic-output/test-SOURCE_DATE_EPOCH.tex b/systems/doc/pdftex/tests/03-deterministic-output/test-SOURCE_DATE_EPOCH.tex
new file mode 100644
index 0000000000..bc037ea01c
--- /dev/null
+++ b/systems/doc/pdftex/tests/03-deterministic-output/test-SOURCE_DATE_EPOCH.tex
@@ -0,0 +1,10 @@
+\input plain.tex
+\input pdftexconfig.tex
+\input pdftexmagfix.tex
+\pdfcompresslevel=0
+\pdfobjcompresslevel=0
+
+abc
+\eject
+def
+\bye
diff --git a/systems/doc/pdftex/tests/03-deterministic-output/test-fixed-date-id.tex b/systems/doc/pdftex/tests/03-deterministic-output/test-fixed-date-id.tex
new file mode 100644
index 0000000000..933ed1b5f5
--- /dev/null
+++ b/systems/doc/pdftex/tests/03-deterministic-output/test-fixed-date-id.tex
@@ -0,0 +1,16 @@
+\input plain.tex
+\input pdftexconfig.tex
+\input pdftexmagfix.tex
+\pdfcompresslevel=0
+\pdfobjcompresslevel=0
+
+\pdfinfo{%
+ /ModDate (D:20150813230402+02'00')
+ /CreationDate (D:20150813230402+02'00')
+}
+\pdftrailerid{test-fixed-date-id.tex:20150813230402+02'00'}
+
+abc
+\eject
+def
+\bye
diff --git a/systems/doc/pdftex/tests/03-deterministic-output/test-no-date-id.tex b/systems/doc/pdftex/tests/03-deterministic-output/test-no-date-id.tex
new file mode 100644
index 0000000000..c8ebf176f4
--- /dev/null
+++ b/systems/doc/pdftex/tests/03-deterministic-output/test-no-date-id.tex
@@ -0,0 +1,13 @@
+\input plain.tex
+\input pdftexconfig.tex
+\input pdftexmagfix.tex
+\pdfcompresslevel=0
+\pdfobjcompresslevel=0
+
+\pdfinfoomitdate=1
+\pdftrailerid{}
+
+abc
+\eject
+def
+\bye
diff --git a/systems/doc/pdftex/tests/03-deterministic-output/test-prim.tex b/systems/doc/pdftex/tests/03-deterministic-output/test-prim.tex
new file mode 100644
index 0000000000..c00641ed4f
--- /dev/null
+++ b/systems/doc/pdftex/tests/03-deterministic-output/test-prim.tex
@@ -0,0 +1,11 @@
+% $Id: test-prim.tex 762 2016-07-05 17:44:56Z karl $
+% See the testprim: target in ./Makefile for the invocation.
+
+\catcode`\{ = 1
+\catcode`\} = 2
+
+\ifnum\year=1970 \else \errmessage{year is \the\year, not 1970}\fi
+\ifnum\month=1 \else \errmessage{month is \the\month, not 1}\fi
+\ifnum\day=1 \else \errmessage{day is \the\day, not 1}\fi
+\ifnum\time=2 \else \errmessage{time is \the\time, not 2}\fi
+\end
diff --git a/systems/doc/pdftex/tests/04-pdfsuppressptexinfo/Makefile b/systems/doc/pdftex/tests/04-pdfsuppressptexinfo/Makefile
new file mode 100644
index 0000000000..554a361248
--- /dev/null
+++ b/systems/doc/pdftex/tests/04-pdfsuppressptexinfo/Makefile
@@ -0,0 +1,40 @@
+# $Id: Makefile 772 2017-03-16 22:58:04Z karl $
+# Public domain.
+
+include ../Common.mak
+
+all: abc-diff testptex-diff testdate-diff testtrailer-diff
+
+abc abc.pdf:
+ $(env) $(prog) '\pdfsuppressptexinfo=1\input' abc.tex </dev/null
+
+abc-orig.pdf:
+ $(env) $(prog) abc.tex </dev/null && mv abc.pdf $@
+abc-diff: abc-orig.pdf abc.pdf
+ -$(diff) $^ # /PTEX.Fullbanner should be gone
+
+testptex = test-pdfsuppressptexinfo
+$(testptex)-orig.pdf: $(testptex).tex abc.pdf
+ $(env) $(prog) $(testptex).tex </dev/null \
+ && mv $(testptex).pdf $(testptex)-orig.pdf
+$(testptex).pdf: $(testptex).tex abc.pdf Makefile
+ $(env) $(prog) '\pdfsuppressptexinfo=-1\input' $(testptex).tex \
+ </dev/null
+testptex-diff: $(testptex)-orig.pdf $(testptex).pdf
+ -$(diff) $^ # all /PTEX.* should be gone
+
+# these are also tested in ../03-deterministic-output, but can try them here.
+testdate = test-pdfinfoomitdate
+$(testdate).pdf: $(testdate).tex abc.pdf
+ $(env) $(prog) $(testdate).tex </dev/null
+testdate-diff: $(testptex)-orig.pdf $(testdate).pdf
+ -$(diff) $^ # /CreationDate, /ModDate should be gone
+
+testtrailer = test-pdftrailer
+$(testtrailer).pdf: $(testtrailer).tex abc.pdf
+ $(env) $(prog) $(testtrailer).tex </dev/null
+testtrailer-diff: $(testptex)-orig.pdf $(testtrailer).pdf
+ -$(diff) $^ # new /mytrlrkey, dates+id should be different
+
+clean:
+ $(clean)
diff --git a/systems/doc/pdftex/tests/04-pdfsuppressptexinfo/abc.tex b/systems/doc/pdftex/tests/04-pdfsuppressptexinfo/abc.tex
new file mode 100644
index 0000000000..045ccbcd2f
--- /dev/null
+++ b/systems/doc/pdftex/tests/04-pdfsuppressptexinfo/abc.tex
@@ -0,0 +1,10 @@
+% $Id: abc.tex 737 2016-03-21 22:54:16Z karl $
+% Public domain.
+\input plain.tex
+\input pdftexconfig.tex
+\input pdftexmagfix.tex
+\pdfcompresslevel=0
+\pdfobjcompresslevel=0
+
+abc
+\bye
diff --git a/systems/doc/pdftex/tests/04-pdfsuppressptexinfo/test-pdfinfoomitdate.tex b/systems/doc/pdftex/tests/04-pdfsuppressptexinfo/test-pdfinfoomitdate.tex
new file mode 100644
index 0000000000..dfd30ceb99
--- /dev/null
+++ b/systems/doc/pdftex/tests/04-pdfsuppressptexinfo/test-pdfinfoomitdate.tex
@@ -0,0 +1,4 @@
+% $Id: test-pdfinfoomitdate.tex 737 2016-03-21 22:54:16Z karl $
+% Public domain.
+\pdfinfoomitdate = 1
+\input test-pdfsuppressptexinfo
diff --git a/systems/doc/pdftex/tests/04-pdfsuppressptexinfo/test-pdfsuppressptexinfo.tex b/systems/doc/pdftex/tests/04-pdfsuppressptexinfo/test-pdfsuppressptexinfo.tex
new file mode 100644
index 0000000000..fac5e30b80
--- /dev/null
+++ b/systems/doc/pdftex/tests/04-pdfsuppressptexinfo/test-pdfsuppressptexinfo.tex
@@ -0,0 +1,18 @@
+% $Id: test-pdfsuppressptexinfo.tex 740 2016-04-23 15:08:37Z karl $
+% Public domain.
+\input plain.tex
+\input pdftexconfig.tex
+\input pdftexmagfix.tex
+\pdfcompresslevel=0
+\pdfobjcompresslevel=0
+
+% \pdfsuppressptexinfo=-1
+% \pdfsuppressptexinfo=15
+% \pdfsuppressptexinfo=8
+% \pdfsuppressptexinfo=4
+% \pdfsuppressptexinfo=2
+% \pdfsuppressptexinfo=1
+
+\pdfximage{abc.pdf}
+\hbox{\pdfrefximage\pdflastximage}
+\bye
diff --git a/systems/doc/pdftex/tests/04-pdfsuppressptexinfo/test-pdftrailer.tex b/systems/doc/pdftex/tests/04-pdfsuppressptexinfo/test-pdftrailer.tex
new file mode 100644
index 0000000000..119292229a
--- /dev/null
+++ b/systems/doc/pdftex/tests/04-pdfsuppressptexinfo/test-pdftrailer.tex
@@ -0,0 +1,6 @@
+% $Id: test-pdftrailer.tex 737 2016-03-21 22:54:16Z karl $
+% Public domain.
+\pdfoutput=1 \catcode`\{=1 \catcode`\}=2
+\pdftrailer {/mytrlrkey /mytrlrval}
+\pdftrailerid {} % seed for trailer id
+\input test-pdfsuppressptexinfo
diff --git a/systems/doc/pdftex/tests/05-mediabox/Makefile b/systems/doc/pdftex/tests/05-mediabox/Makefile
new file mode 100644
index 0000000000..6f45b14cac
--- /dev/null
+++ b/systems/doc/pdftex/tests/05-mediabox/Makefile
@@ -0,0 +1,18 @@
+# $Id: Makefile 772 2017-03-16 22:58:04Z karl $
+# Public domain.
+
+include ../Common.mak
+
+default: test-normal test-omit-mediabox
+
+test-normal:
+ $(prog) test-normal.tex
+ grep -q /MediaBox.*314 test-normal.pdf
+
+test-omit-mediabox:
+ $(prog) test-omit-mediabox.tex
+ grep -q /MediaBox.*271 test-omit-mediabox.pdf # should be there
+ ! grep -q /MediaBox.*314 test-omit-mediabox.pdf # should not
+
+clean:
+ $(clean)
diff --git a/systems/doc/pdftex/tests/05-mediabox/test-normal.tex b/systems/doc/pdftex/tests/05-mediabox/test-normal.tex
new file mode 100644
index 0000000000..f054485556
--- /dev/null
+++ b/systems/doc/pdftex/tests/05-mediabox/test-normal.tex
@@ -0,0 +1,7 @@
+% $Id: test-normal.tex 772 2017-03-16 22:58:04Z karl $
+% Public domain.
+
+\pdfoutput=1
+\pdfpagewidth=314bp
+\pdfpageheight=315bp
+X.\end
diff --git a/systems/doc/pdftex/tests/05-mediabox/test-omit-mediabox.tex b/systems/doc/pdftex/tests/05-mediabox/test-omit-mediabox.tex
new file mode 100644
index 0000000000..93eb60dbc1
--- /dev/null
+++ b/systems/doc/pdftex/tests/05-mediabox/test-omit-mediabox.tex
@@ -0,0 +1,8 @@
+% $Id: test-omit-mediabox.tex 772 2017-03-16 22:58:04Z karl $
+% Public domain.
+
+\pdfoutput=1 \catcode`\{=1 \catcode`\}=2
+\pdfpagewidth=314bp
+\pdfpageheight=315bp
+\pdfpageattr{/MediaBox [ 0 1 271 272 ]}
+X.\end
diff --git a/systems/doc/pdftex/tests/06-pkmap/Makefile b/systems/doc/pdftex/tests/06-pkmap/Makefile
new file mode 100644
index 0000000000..853ec0eb2b
--- /dev/null
+++ b/systems/doc/pdftex/tests/06-pkmap/Makefile
@@ -0,0 +1,24 @@
+# $Id: Makefile 777 2017-04-20 23:08:32Z karl $
+# Public domain.
+
+include ../Common.mak
+
+default: test-pkmap
+
+test-pkenc: # cmr10.3600pk - not used
+ $(prog) test-pkmap.tex
+#
+# should work when and if patch is applied:
+# grep -q /ffi test-pkenc.pdf # should end up with this encoded char
+# grep -a ToUnicode test-pkenc.pdf
+#
+# dev convenience:
+# pdffonts test-big.pdf
+# pdftotext test-big.pdf -
+
+cmr10.3600pk:
+ mf-nowin '\mode:=ljfour;mag:=6;input cmr10'
+ gftopk cmr10.3600gf
+
+clean:
+ $(clean)
diff --git a/systems/doc/pdftex/tests/06-pkmap/cmb10.72pk b/systems/doc/pdftex/tests/06-pkmap/cmb10.72pk
new file mode 100644
index 0000000000..9de73dcd0f
--- /dev/null
+++ b/systems/doc/pdftex/tests/06-pkmap/cmb10.72pk
Binary files differ
diff --git a/systems/doc/pdftex/tests/06-pkmap/cmr10.72pk b/systems/doc/pdftex/tests/06-pkmap/cmr10.72pk
new file mode 100644
index 0000000000..35ed3e2158
--- /dev/null
+++ b/systems/doc/pdftex/tests/06-pkmap/cmr10.72pk
Binary files differ
diff --git a/systems/doc/pdftex/tests/06-pkmap/prepatch.pdf b/systems/doc/pdftex/tests/06-pkmap/prepatch.pdf
new file mode 100644
index 0000000000..07617bdba2
--- /dev/null
+++ b/systems/doc/pdftex/tests/06-pkmap/prepatch.pdf
Binary files differ
diff --git a/systems/doc/pdftex/tests/06-pkmap/test-pkmap.tex b/systems/doc/pdftex/tests/06-pkmap/test-pkmap.tex
new file mode 100644
index 0000000000..f78d7c095d
--- /dev/null
+++ b/systems/doc/pdftex/tests/06-pkmap/test-pkmap.tex
@@ -0,0 +1,37 @@
+% $Id: test-pkmap.tex 777 2017-04-20 23:08:32Z karl $
+% Public domain.
+% Test map files with bitmap (i.e., Type 3) fonts.
+
+% A thread starting here:
+% http://tug.org/pipermail/pdftex/2016-July/009064.html
+% and continuing here (and more):
+% http://tug.org/pipermail/pdftex/2016-August/009065.html
+% discusses a patch for supporting an encoding file with Type 3.
+% The patch has not yet been installed.
+%
+% For comparison, the PDF made before the patch was applied is saved
+% here as prepatch.pdf.
+%
+% The default PK resolution is 72, so we made cmb10.72pk in this directory.
+% (mf-nowin '\mode:=mactrue; input cmb10' && gftopk cmb10.72gf)
+% (mf-nowin '\mode:=mactrue; input cmr10' && gftopk cmr10.72gf)
+%
+\pdfoutput=1 \catcode`\{=1 \catcode`\}=2
+\hsize=6pc \parfillskip=0pt plus1fil \vsize=6in \lineskip=1pc
+\pdfcompresslevel=0 \pdfobjcompresslevel=0
+
+\pdfglyphtounicode{ffi}{0066 0066 0069} %no need for all: \input glyphtounicode
+\pdfgentounicode=1
+
+\pdfmapline{cmr10}% type3 map without encoding - no ToUnicode, no /ffi.
+\font\cmr=cmr10 \noindent \cmr ffi
+
+% if we install the patch.
+%\pdfmapline{cmb10 <7t.enc}% type3 map with encoding
+%\font\cmb=cmb10 \noindent \cmb ffi
+
+% geometrically-scaled tfm: the Type 3 should be scaled (resulting in
+% blocky blown-up bits), instead of using a separately-generated
+% cmr10.360pk (50*72/10).
+\font\big = cmr10 at 50pt \big big
+\end
diff --git a/systems/doc/pdftex/tests/07-mapwarn/Makefile b/systems/doc/pdftex/tests/07-mapwarn/Makefile
new file mode 100644
index 0000000000..6e40de9242
--- /dev/null
+++ b/systems/doc/pdftex/tests/07-mapwarn/Makefile
@@ -0,0 +1,12 @@
+# $Id: Makefile 777 2017-04-20 23:08:32Z karl $
+# Public domain.
+
+include ../Common.mak
+
+default: test-mapwarn
+
+test-mapwarn:
+ $(prog) test-mapwarn.tex; test $$? = 1 # pdftex should exit 1
+
+clean:
+ $(clean)
diff --git a/systems/doc/pdftex/tests/07-mapwarn/test-mapwarn.tex b/systems/doc/pdftex/tests/07-mapwarn/test-mapwarn.tex
new file mode 100644
index 0000000000..7088ab2a8a
--- /dev/null
+++ b/systems/doc/pdftex/tests/07-mapwarn/test-mapwarn.tex
@@ -0,0 +1,18 @@
+% $Id: test-mapwarn.tex 777 2017-04-20 23:08:32Z karl $
+% Public domain.
+% Ensure that various invalid map lines don't cause a crash.
+% The last line aborts due to a (detected) buffer overflow.
+
+\pdfoutput=1 \catcode`\{=1 \catcode`\}=2
+\catcode`\^=7 \newlinechar=`\^^J
+
+% all but the first should cause warnings.
+\message{empty^^J}\pdfmapline{}
+\message{just <^^J}\pdfmapline{<}
+\message{justtfm<^^J}\pdfmapline{cmb10x1<}
+\message{justtfm <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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}
+\end
diff --git a/systems/doc/pdftex/tests/Common.mak b/systems/doc/pdftex/tests/Common.mak
new file mode 100644
index 0000000000..04e3afd2c1
--- /dev/null
+++ b/systems/doc/pdftex/tests/Common.mak
@@ -0,0 +1,34 @@
+# $Id: Common.mak 777 2017-04-20 23:08:32Z karl $
+# Public domain.
+
+# Common Makefile definitions to run pdftex from test hierarchy,
+# but use support files from an installation.
+
+tl = /usr/local/texlive-rel
+tl_dist = $(tl)/texmf-dist
+#
+plain = $(tl_dist)/tex/plain/base
+plain_config = $(tl_dist)/tex/plain/config
+generic_config = $(tl)/texmf-config/tex/generic/config
+generic_hyphen = $(tl_dist)/tex/generic/hyphen
+#
+tfm_cm = $(tl_dist)/fonts/tfm/public/cm
+tfm_knuth = $(tl_dist)/fonts/tfm/public/knuth-lib
+t1_cm = $(tl_dist)/fonts/type1/public/amsfonts/cm
+#
+env = TEXINPUTS=.:$(plain):$(plain_config):$(generic_config):$(generic_hyphen)\
+ TEXFONTS=.:$(tfm_cm):$(tfm_knuth):$(t1_cm) \
+ TEXFONTMAPS=$(tl_dist)/fonts/map/pdftex/updmap \
+ ENCFONTS=$(tl_dist)/fonts/enc/dvips/base \
+ MKTEXTFM=0 \
+ MKTEXPK=0 \
+ KPATHSEA_WARNING=0
+
+diff = diff --text -c0
+
+pdftex = ../../source/build-pdftex/texk/web2c/pdftex
+pdftex = $(W)/texk/web2c/pdftex
+prog = $(env) $(pdftex) -ini -interaction=nonstopmode
+
+# can't make the clean: target here since then it would be the default.
+clean = rm -f *.log *.pdf *.fmt *.aux