diff options
author | Takuji Tanaka <ttk@t-lab.opal.ne.jp> | 2020-05-03 03:45:53 +0000 |
---|---|---|
committer | Takuji Tanaka <ttk@t-lab.opal.ne.jp> | 2020-05-03 03:45:53 +0000 |
commit | 3fcf1ecc08d34e8b56f5dc2a9e5941a25cb38fcd (patch) | |
tree | 8165e22f4251ca4d0c132e250a992c50d355c456 | |
parent | 7636de1dbe4a15521f6b6c30ced338990b8542c4 (diff) |
texk/dvipdfm-x: add test for upTeX VF
git-svn-id: svn://tug.org/texlive/trunk@54979 c570f23f-e606-0410-a88d-b1316a301751
17 files changed, 217 insertions, 6 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index de13ac01a15..a523e09c7cd 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,3 +1,12 @@ +2020-05-03 TANAKA Takuji <ttk@t-lab.opal.ne.jp> + + * dvipdfmx-upjf.test, Makefile.{am,in}, + tests/Makefile_upjf, tests/upjf{,-r,-g}.tfm, + tests/upjf.{tex,dvi,map}, tests/upjf_{full,omit}.vf, + tests/upjf_{full,omit}.cnf, tests/UPJF-UTF16-H: + Add a new test for fallback of virtual fonts. + * vf.c: Tweak debugging message for fallback of virtual fonts. + 2020-03-27 Karl Berry <karl@tug.org> * TeX Live 2020. @@ -7,6 +16,14 @@ * tfm.c, tfm.h, vf.c: Fallback multibyte character in virtual font for (u)pTeX. * configure.ac: version 20200315. + https://github.com/texjporg/tex-jp-build/issues/99 + + A new rule for virtual fonts are implemented: + If a virtual font has no entry of a codepoint and the first + MAPFONT designates a (u)pTeX TFM(JFM), then we designate the + glyph (usually with a fullwidth metric) of the same codepoint + in the TFM(JFM) with the smallest font ID. + The new rule helps to shrink size of Japanese virtual fonts. 2020-02-29 Hironobu Yamashita <h.y.acetaminophen@gmail.com> diff --git a/Build/source/texk/dvipdfm-x/Makefile.am b/Build/source/texk/dvipdfm-x/Makefile.am index 64f03ea3e8d..160a03028e2 100644 --- a/Build/source/texk/dvipdfm-x/Makefile.am +++ b/Build/source/texk/dvipdfm-x/Makefile.am @@ -248,6 +248,7 @@ DISTCLEANFILES = config.force TESTS = xdvipdfmx.test xdvipdfm-ann.test xdvipdfm-bad.test xdvipdfm-bb.test TESTS += xdvipdfm-bkm.test xdvipdfm-psz.test xdvipdfm-ptx.test xdvipdfm-res.test TESTS += xdvipdfm-rev.test xdvipdfm-ttc.test +TESTS += dvipdfmx-upjf.test xdvipdfmx.log xdvipdfm-ann.log xdvipdfm-bad.log xdvipdfm-bb.log \ xdvipdfm-bkm.log xdvipdfm-psz.log xdvipdfm-ptx.log xdvipdfm-res.log \ xdvipdfm-rev.log xdvipdfm-ttc.log: xdvipdfmx$(EXEEXT) @@ -290,5 +291,10 @@ DISTCLEANFILES += reverse.pdf ## xdvipdfm-ttc.test EXTRA_DIST += tests/ttc.dvi tests/ttc.tex tests/test.ttc DISTCLEANFILES += ttc*.pdf +## dvipdfmx-upjf.test +EXTRA_DIST += tests/upjf.dvi tests/upjf.tex tests/upjf.map tests/Makefile_upjf +EXTRA_DIST += tests/upjf_full.cnf tests/upjf_omit.cnf tests/upjf_full.vf tests/upjf_omit.vf +EXTRA_DIST += tests/upjf-r.tfm tests/upjf-g.tfm tests/upjf.tfm tests/UPJF-UTF16-H +DISTCLEANFILES += upjf.vf upjf*.pdf ## EXTRA_DIST += tests/fullmap.dvi tests/fullmap.tex diff --git a/Build/source/texk/dvipdfm-x/Makefile.in b/Build/source/texk/dvipdfm-x/Makefile.in index c49a9ca535a..c7d8f46d793 100644 --- a/Build/source/texk/dvipdfm-x/Makefile.in +++ b/Build/source/texk/dvipdfm-x/Makefile.in @@ -628,6 +628,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -817,11 +818,11 @@ cmapdatadir = $(datarootdir)/texmf-dist/fonts/cmap/dvipdfmx dist_cmapdata_DATA = data/EUC-UCS2 DISTCLEANFILES = config.force image*.pdf xbmc*.pdf annot*.pdf pic*.* \ bookm*.pdf paper*.pdf ptex*.pdf resrc*.pdf reverse.pdf \ - ttc*.pdf + ttc*.pdf upjf.vf upjf*.pdf TESTS = xdvipdfmx.test xdvipdfm-ann.test xdvipdfm-bad.test \ xdvipdfm-bb.test xdvipdfm-bkm.test xdvipdfm-psz.test \ xdvipdfm-ptx.test xdvipdfm-res.test xdvipdfm-rev.test \ - xdvipdfm-ttc.test + xdvipdfm-ttc.test dvipdfmx-upjf.test EXTRA_DIST = $(TESTS) tests/dvipdfmx.cfg tests/psfonts.map \ tests/cmr10.pfb tests/cmr10.tfm tests/image.dvi \ tests/image.tex tests/xbmc.dvi tests/xbmc.tex \ @@ -837,7 +838,11 @@ EXTRA_DIST = $(TESTS) tests/dvipdfmx.cfg tests/psfonts.map \ tests/picpdf.xbb tests/bookm.dvi tests/bookm.tex \ tests/paper.dvi tests/paper.tex tests/ptex.dvi tests/resrc.dvi \ tests/resrc.tex tests/reverse.dvi tests/ttc.dvi tests/ttc.tex \ - tests/test.ttc tests/fullmap.dvi tests/fullmap.tex + tests/test.ttc tests/upjf.dvi tests/upjf.tex tests/upjf.map \ + tests/Makefile_upjf tests/upjf_full.cnf tests/upjf_omit.cnf \ + tests/upjf_full.vf tests/upjf_omit.vf tests/upjf-r.tfm \ + tests/upjf-g.tfm tests/upjf.tfm tests/UPJF-UTF16-H \ + tests/fullmap.dvi tests/fullmap.tex all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am diff --git a/Build/source/texk/dvipdfm-x/dvipdfmx-upjf.test b/Build/source/texk/dvipdfm-x/dvipdfmx-upjf.test new file mode 100755 index 00000000000..daa090831a6 --- /dev/null +++ b/Build/source/texk/dvipdfm-x/dvipdfmx-upjf.test @@ -0,0 +1,38 @@ +#! /bin/sh -vx +# $Id$ +# Copyright 2020 Japanese TeX Development Community <issue@texjp.org> +# You may freely use, modify and/or distribute this file. + +TEXMFCNF=$srcdir/../kpathsea +TFMFONTS="$srcdir/tests;$srcdir/data" +T1FONTS="$srcdir/tests;$srcdir/data" +TEXFONTMAPS="$srcdir/tests;$srcdir/data" +DVIPDFMXINPUTS="$srcdir/tests;$srcdir/data" +TEXPICTS=$srcdir/tests +TEXFONTS="$srcdir/tests;." +SOURCE_DATE_EPOCH=1588474800 +export TEXMFCNF TFMFONTS T1FONTS TEXFONTMAPS DVIPDFMXINPUTS TEXPICTS TEXFONTS SOURCE_DATE_EPOCH + +failed= + +echo "*** dvipdfmx: test for upjf_full.pdf" && echo \ + && cp $srcdir/tests/upjf_full.vf ./upjf.vf \ + && ./xdvipdfmx --dvipdfmx -v -f upjf.map -o upjf.pdf $srcdir/tests/upjf.dvi \ + && mv ./upjf.pdf ./upjf_full.pdf \ + && echo && echo "dvipdfmx-upjf-vf_full tests OK" && echo \ + || failed="$failed dvipdfmx-upjf-vf_full" + +echo "*** dvipdfmx: test for upjf_omit.pdf" && echo \ + && cp $srcdir/tests/upjf_omit.vf ./upjf.vf \ + && ./xdvipdfmx --dvipdfmx -v -f upjf.map -o upjf.pdf $srcdir/tests/upjf.dvi \ + && mv ./upjf.pdf ./upjf_omit.pdf \ + && echo && echo "dvipdfmx-upjf-vf_omit tests OK" && echo \ + || failed="$failed dvipdfmx-upjf-vf_omit" + +cmp ./upjf_full.pdf ./upjf_omit.pdf || failed="$failed dvipdfmx-upjf-cmp" + +test -z "$failed" && exit 0 +echo +echo "failed tests:$failed" +exit 1 + diff --git a/Build/source/texk/dvipdfm-x/tests/Makefile_upjf b/Build/source/texk/dvipdfm-x/tests/Makefile_upjf new file mode 100644 index 00000000000..d22dda7005c --- /dev/null +++ b/Build/source/texk/dvipdfm-x/tests/Makefile_upjf @@ -0,0 +1,20 @@ +# Public domain. +# You may freely use, modify and/or distribute this file. + +# test data for uptex virtual fonts +uptex-vf: upjf_full.vf upjf_omit.vf upjf.dvi + +upjf.tfm: + cp -p `kpsewhich upjisr-h.tfm` upjf.tfm + +upjf_full.vf: upjf.tfm upjf_full.cnf + makejvf -i -u custom -e -t upjf_full.cnf -H upjf.tfm -K upjf-g upjf-r + mv upjf.vf upjf_full.vf + +upjf_omit.vf: upjf.tfm upjf_omit.cnf + makejvf -i -u custom -e -t upjf_omit.cnf -H upjf.tfm -K upjf-g upjf-r + mv upjf.vf upjf_omit.vf + +upjf.dvi: upjf.tex + uplatex upjf.tex + diff --git a/Build/source/texk/dvipdfm-x/tests/UPJF-UTF16-H b/Build/source/texk/dvipdfm-x/tests/UPJF-UTF16-H new file mode 100644 index 00000000000..a63768ab58a --- /dev/null +++ b/Build/source/texk/dvipdfm-x/tests/UPJF-UTF16-H @@ -0,0 +1,71 @@ +%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (UPJF-UTF16-H) +%%Title: (UPJF-UTF16-H test sample) +%%Version: 1.000 +%%Copyright: ----------------------------------------------------------- +%%Copyright: Copyright 2017-2020 Japanese TeX Development Community +%%Copyright: +%%Copyright: You may freely use, modify and/or distribute this file. +%%Copyright: ----------------------------------------------------------- +%%EndComments + +/CIDInit /ProcSet findresource begin + +12 dict begin + +begincmap + +/CIDSystemInfo 3 dict dup begin + /Registry (Adobe) def + /Ordering (Japan1) def + /Supplement 7 def +end def + +/CMapName /UPJF-UTF16-H def +/CMapVersion 1.000 def +/CMapType 1 def + +/WMode 0 def + +3 begincodespacerange + <0000> <D7FF> + <D800DC00> <DBFFDFFF> + <E000> <FFFF> +endcodespacerange + +1 beginnotdefrange +<0000> <001f> 1 +endnotdefrange + +3 begincidchar +<6674> 2646 +<96ea> 2695 +<d842df9f> 13803 +endcidchar + +14 begincidrange +<2600> <2603> 8215 +<3000> <3002> 633 +<3005> <3007> 657 +<3008> <3011> 682 +<3014> <3015> 676 +<3016> <3017> 16197 +<3018> <3019> 12129 +<3033> <3035> 12108 +<3041> <3093> 842 +<3094> <3096> 7958 +<3099> <309a> 16326 +<309b> <309c> 643 +<309d> <309e> 653 +<ff61> <ff9f> 327 +endcidrange + +endcmap +CMapName currentdict /CMap defineresource pop +end +end + +%%EndResource +%%EOF diff --git a/Build/source/texk/dvipdfm-x/tests/upjf-g.tfm b/Build/source/texk/dvipdfm-x/tests/upjf-g.tfm Binary files differnew file mode 100644 index 00000000000..3f0bfdff987 --- /dev/null +++ b/Build/source/texk/dvipdfm-x/tests/upjf-g.tfm diff --git a/Build/source/texk/dvipdfm-x/tests/upjf-r.tfm b/Build/source/texk/dvipdfm-x/tests/upjf-r.tfm Binary files differnew file mode 100644 index 00000000000..8dbf787b3ec --- /dev/null +++ b/Build/source/texk/dvipdfm-x/tests/upjf-r.tfm diff --git a/Build/source/texk/dvipdfm-x/tests/upjf.dvi b/Build/source/texk/dvipdfm-x/tests/upjf.dvi Binary files differnew file mode 100644 index 00000000000..1e5473dc81b --- /dev/null +++ b/Build/source/texk/dvipdfm-x/tests/upjf.dvi diff --git a/Build/source/texk/dvipdfm-x/tests/upjf.map b/Build/source/texk/dvipdfm-x/tests/upjf.map new file mode 100644 index 00000000000..8203ec49a68 --- /dev/null +++ b/Build/source/texk/dvipdfm-x/tests/upjf.map @@ -0,0 +1,9 @@ +%upjf-r UniJIS-UTF16-H HaranoAjiMincho-Regular.otf +%upjf-g UniJIS-UTF16-H HaranoAjiGothic-Regular.otf + +%upjf-r UniJIS-UTF16-H !Ryumin-Light +%upjf-g UniJIS-UTF16-H !GothicBBB-Medium + +upjf-r UPJF-UTF16-H !Ryumin-Light +upjf-g UPJF-UTF16-H !GothicBBB-Medium + diff --git a/Build/source/texk/dvipdfm-x/tests/upjf.tex b/Build/source/texk/dvipdfm-x/tests/upjf.tex new file mode 100644 index 00000000000..de471281b2f --- /dev/null +++ b/Build/source/texk/dvipdfm-x/tests/upjf.tex @@ -0,0 +1,19 @@ +% Copyright (C) 2020 Japanese TeX Development Community +% You may freely use, modify and/or distribute this file. + +\documentclass{ujarticle} + +% for dvipdfmx +%\AtBeginDvi{\special{pdf:mapline upjf-r UniJIS-UTF16-H HaranoAjiMincho-Regular.otf}} +%\AtBeginDvi{\special{pdf:mapline upjf-g UniJIS-UTF16-H HaranoAjiGothic-Regular.otf}} +%\AtBeginDvi{\special{pdf:mapline upjf-r UniJIS-UTF16-H !Ryumin-Light}} +%\AtBeginDvi{\special{pdf:mapline upjf-g UniJIS-UTF16-H !GothicBBB-Medium}} +%\AtBeginDvi{\special{pdf:mapline upjf-r UPJF-UTF16-H !Ryumin-Light}} +%\AtBeginDvi{\special{pdf:mapline upjf-g UPJF-UTF16-H !GothicBBB-Medium}} + +\begin{document} +\pagestyle{empty} +\font\upjf=upjf at 10pt +\upjf あいうえおアイウエオ、☃~雪晴☀𠮟。 +\end{document} + diff --git a/Build/source/texk/dvipdfm-x/tests/upjf.tfm b/Build/source/texk/dvipdfm-x/tests/upjf.tfm Binary files differnew file mode 100644 index 00000000000..d18f4d546c8 --- /dev/null +++ b/Build/source/texk/dvipdfm-x/tests/upjf.tfm diff --git a/Build/source/texk/dvipdfm-x/tests/upjf_full.cnf b/Build/source/texk/dvipdfm-x/tests/upjf_full.cnf new file mode 100644 index 00000000000..5ba8a501631 --- /dev/null +++ b/Build/source/texk/dvipdfm-x/tests/upjf_full.cnf @@ -0,0 +1,13 @@ +% makejvf settings for test +% You may freely use, modify and/or distribute this file. + +CHARSET % ++ 2600,% ☀ ++ 2603,% ☃ ++ 3000..303F,% CJK Symbols and Punctuation ++ 3040..309F,% Hiragana ++ 6674,% 晴 ++ 96EA,% 雪 ++ FF00..FFEF,% Halfwidth and Fullwidth Forms ++ 20B9F% 𠮟 + diff --git a/Build/source/texk/dvipdfm-x/tests/upjf_full.vf b/Build/source/texk/dvipdfm-x/tests/upjf_full.vf Binary files differnew file mode 100644 index 00000000000..342ea0fdc38 --- /dev/null +++ b/Build/source/texk/dvipdfm-x/tests/upjf_full.vf diff --git a/Build/source/texk/dvipdfm-x/tests/upjf_omit.cnf b/Build/source/texk/dvipdfm-x/tests/upjf_omit.cnf new file mode 100644 index 00000000000..dbb1af7ffc2 --- /dev/null +++ b/Build/source/texk/dvipdfm-x/tests/upjf_omit.cnf @@ -0,0 +1,13 @@ +% makejvf settings for test +% You may freely use, modify and/or distribute this file. + +CHARSET % ++ 2600,% ☀ ++ 2603,% ☃ ++ 3000..303F,% CJK Symbols and Punctuation ++ 3040..309F,% Hiragana ++ 6674,% 晴 +%+ 96EA,% 雪 ++ FF00..FFEF,% Halfwidth and Fullwidth Forms +%+ 20B9F% 𠮟 + diff --git a/Build/source/texk/dvipdfm-x/tests/upjf_omit.vf b/Build/source/texk/dvipdfm-x/tests/upjf_omit.vf Binary files differnew file mode 100644 index 00000000000..e9bbe6ea2fb --- /dev/null +++ b/Build/source/texk/dvipdfm-x/tests/upjf_omit.vf diff --git a/Build/source/texk/dvipdfm-x/vf.c b/Build/source/texk/dvipdfm-x/vf.c index a6361715494..1495490ae34 100644 --- a/Build/source/texk/dvipdfm-x/vf.c +++ b/Build/source/texk/dvipdfm-x/vf.c @@ -413,12 +413,12 @@ void vf_set_char(int32_t ch, int vf_font) dvi_vf_init (default_font); if (ch >= vf_fonts[vf_font].num_chars || !(start = (vf_fonts[vf_font].ch_pkt)[ch])) { - if (tfm_is_jfm((vf_fonts[vf_font].dev_fonts[0]).tfm_id) && + if (tfm_is_jfm(vf_fonts[vf_font].dev_fonts[0].tfm_id) && ch < 0x1000000 && dpx_conf.compat_mode != dpx_mode_xdv_mode) { /* fallback multibyte character for (u)pTeX */ if (dpx_conf.verbose_level > 0) - WARN ("Fallback multibyte character in virtual font: name=%s char=0x%06x(%d)", - vf_fonts[vf_font].tex_name, ch, ch); + WARN ("Fallback multibyte character in virtual font: VF:%s char=0x%06x(%d) to TFM:%s", + vf_fonts[vf_font].tex_name, ch, ch, vf_fonts[vf_font].dev_fonts[0].name); dvi_set (ch); dvi_vf_finish(); return; |