summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c
diff options
context:
space:
mode:
authorHironobu Yamashita <h.y.acetaminophen@gmail.com>2018-02-02 13:13:02 +0000
committerHironobu Yamashita <h.y.acetaminophen@gmail.com>2018-02-02 13:13:02 +0000
commit9f7307579d809c7eca4c350e128045715a77303c (patch)
tree72d1a2f4e738d67f3d2d7837f407b8b8ecf50ee8 /Build/source/texk/web2c
parent766f9e22c66d047e709bffc758c53a4b853e710e (diff)
ptexdir, uptexdir: support SKIP property in GLUEKERN and rearrangement
git-svn-id: svn://tug.org/texlive/trunk@46518 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c')
-rw-r--r--Build/source/texk/web2c/Makefile.in36
-rw-r--r--Build/source/texk/web2c/ptexdir/ChangeLog13
-rw-r--r--Build/source/texk/web2c/ptexdir/am/ptex.am6
-rw-r--r--Build/source/texk/web2c/ptexdir/ppltotf.ch26
-rw-r--r--Build/source/texk/web2c/ptexdir/ptex-base.ch37
-rw-r--r--Build/source/texk/web2c/ptexdir/ptftopl.ch2
-rwxr-xr-xBuild/source/texk/web2c/ptexdir/skipjfmp.test22
-rw-r--r--Build/source/texk/web2c/ptexdir/tests/skipjfmp.pl159
-rw-r--r--Build/source/texk/web2c/ptexdir/tests/skipjfmp.tex33
-rw-r--r--Build/source/texk/web2c/ptexdir/tests/skipjfmp.tfmbin0 -> 632 bytes
-rw-r--r--Build/source/texk/web2c/uptexdir/ChangeLog7
-rw-r--r--Build/source/texk/web2c/uptexdir/am/uptex.am17
-rwxr-xr-xBuild/source/texk/web2c/uptexdir/gkhuge.test36
-rw-r--r--Build/source/texk/web2c/uptexdir/tests/gkhuge.tex33
-rw-r--r--Build/source/texk/web2c/uptexdir/tests/gkhugeng.tfmbin0 -> 133344 bytes
-rw-r--r--Build/source/texk/web2c/uptexdir/tests/gkhugeok.tfmbin0 -> 121144 bytes
-rw-r--r--Build/source/texk/web2c/uptexdir/tests/uparse.pl70
-rw-r--r--Build/source/texk/web2c/uptexdir/tests/uparse.tfmbin0 -> 272 bytes
-rwxr-xr-xBuild/source/texk/web2c/uptexdir/uparse.test31
-rw-r--r--Build/source/texk/web2c/uptexdir/uppltotf.ch29
20 files changed, 503 insertions, 54 deletions
diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in
index 4686ca6a8ec..b9585f04b90 100644
--- a/Build/source/texk/web2c/Makefile.in
+++ b/Build/source/texk/web2c/Makefile.in
@@ -2388,6 +2388,7 @@ EXTRA_DIST = PROJECTS cftests cpascal.h help.h w2c/config.h \
ptexdir/tests/goth10.tfm ptexdir/tests/sample.dvi \
ptexdir/tests/min10.pl ptexdir/tests/min10.tfm \
ptexdir/tests/tmin10.pl ptexdir/tests/tmin10.tfm \
+ ptexdir/tests/skipjfmp.pl ptexdir/tests/skipjfmp.tfm \
ptexdir/ptrip/ptrip.diffs ptexdir/ptrip/texmf.cnf \
$(eptex_web_srcs) $(eptex_ch_srcs) eptexdir/eptex.defines \
eptexdir/ChangeLog eptexdir/Changes.txt eptexdir/README.txt \
@@ -2404,6 +2405,8 @@ EXTRA_DIST = PROJECTS cftests cpascal.h help.h w2c/config.h \
uptexdir/tests/umin10.pl uptexdir/tests/umin10.tfm \
uptexdir/tests/utmin10.pl uptexdir/tests/utmin10.tfm \
uptexdir/tests/testnewu.pl uptexdir/tests/testnewu.tfm \
+ uptexdir/tests/uparse.pl uptexdir/tests/uparse.tfm \
+ uptexdir/tests/gkhugeok.tfm uptexdir/tests/gkhugeng.tfm \
uptexdir/uptrip/uptrip.diffs uptexdir/uptrip/texmf.cnf \
$(euptex_web_srcs) $(euptex_ch_srcs) euptexdir/euptex.defines \
euptexdir/COPYRIGHT euptexdir/COPYRIGHT.jis \
@@ -2685,22 +2688,23 @@ DISTCLEANFILES = CXXLD.sh tangle.c tangle.h tangle.p tangle-web2c \
ptests/xexampl.blg ptests/memtest.bib ptests/memtest?.* \
ptests/xstory.dvityp ptests/xpagenum.typ ptests/xcmr10.tfm \
ptests/xcmr10.pl ptests/xsample.typ ptests/x*min10.* \
- ptrip.diffs $(nodist_eptex_SOURCES) eptex.web eptex.ch \
- eptex-web2c eptex.p eptex.pool eptex-tangle eptrip.diffs \
- pdfprimitive-eptex.* $(nodist_uptex_SOURCES) uptex.web \
- uptex.ch uptex-web2c uptex.p uptex.pool uptex-tangle \
+ ptests/xskipjfmp.* ptrip.diffs $(nodist_eptex_SOURCES) \
+ eptex.web eptex.ch eptex-web2c eptex.p eptex.pool eptex-tangle \
+ eptrip.diffs pdfprimitive-eptex.* $(nodist_uptex_SOURCES) \
+ uptex.web uptex.ch uptex-web2c uptex.p uptex.pool uptex-tangle \
$(upweb_programs:=.c) $(upweb_programs:=.h) \
$(upweb_programs:=.p) $(upweb_programs:=-web2c) \
$(upweb_programs:=.web) uptests/xexampl.aux \
uptests/xexampl.bbl uptests/xexampl.blg uptests/xstory.dvityp \
uptests/xpagenum.typ uptests/xcmr10.tfm uptests/xcmr10.pl \
- uptests/x*min10.* uptests/xtestnewu.* uptrip.diffs \
- $(nodist_euptex_SOURCES) euptex.web euptex.ch euptex-web2c \
- euptex.p euptex.pool euptex-tangle euptrip.diffs \
- pdfprimitive-euptex.* $(nodist_pdftex_SOURCES) pdftex.ch \
- pdftex-web2c pdftex.p pdftex.pool pdftex-tangle pwprob.log \
- pwprob.tex pdfimage.fmt pdfimage.log pdfimage.pdf postV3.afm \
- postV7.afm test-13.pdf test-13.xref test-15.pdf test-15.xref \
+ uptests/x*min10.* uptests/xtestnewu.* uptests/*uparse.* \
+ uptests/*gkhuge*.* uptrip.diffs $(nodist_euptex_SOURCES) \
+ euptex.web euptex.ch euptex-web2c euptex.p euptex.pool \
+ euptex-tangle euptrip.diffs pdfprimitive-euptex.* \
+ $(nodist_pdftex_SOURCES) pdftex.ch pdftex-web2c pdftex.p \
+ pdftex.pool pdftex-tangle pwprob.log 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_sources) luaimage.* luajitimage.* \
$(nodist_xetex_SOURCES) xetex.web xetex.ch xetex-web2c xetex.p \
xetex.pool xetex-tangle bug73.fmt bug73.log bug73.out \
@@ -3150,7 +3154,8 @@ pweb_tests = ptexdir/pbibtex.test ptexdir/pdvitype.test \
ptexdir/ppltotf.test ptexdir/ptftopl.test \
ptexdir/pbibtex-openout-test.pl \
ptexdir/pbibtex-longline-test.pl ptexdir/pbibtex-mem.test \
- ptexdir/nissya.test ptexdir/sample.test ptexdir/yokotate.test
+ ptexdir/nissya.test ptexdir/sample.test ptexdir/yokotate.test \
+ ptexdir/skipjfmp.test
eptex_CPPFLAGS = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS) -I$(srcdir)/libmd5 \
$(am__append_135)
@@ -3251,7 +3256,9 @@ upweb_tests = \
uptexdir/uppltotf.test \
uptexdir/uptftopl.test \
uptexdir/yokotate.test \
- uptexdir/newjfm.test
+ uptexdir/newjfm.test \
+ uptexdir/uparse.test \
+ uptexdir/gkhuge.test
euptex_CPPFLAGS = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS) \
-I$(srcdir)/libmd5 $(am__append_139)
@@ -17448,6 +17455,7 @@ ptexdir/pdvitype.log ptexdir/sample.log: pdvitype$(EXEEXT)
ptexdir/ppltotf.log: ppltotf$(EXEEXT)
ptexdir/ptftopl.log: ptftopl$(EXEEXT)
ptexdir/yokotate.log: ppltotf$(EXEEXT) ptftopl$(EXEEXT)
+ptexdir/skipjfmp.log: ppltotf$(EXEEXT) ptftopl$(EXEEXT)
ptrip.diffs: ptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
$(triptrap_diffs) $@
.PHONY: ptrip-clean
@@ -17555,6 +17563,8 @@ uptexdir/uppltotf.log: uppltotf$(EXEEXT)
uptexdir/uptftopl.log: uptftopl$(EXEEXT)
uptexdir/yokotate.log: uppltotf$(EXEEXT) uptftopl$(EXEEXT)
uptexdir/newjfm.log: uppltotf$(EXEEXT) uptftopl$(EXEEXT)
+uptexdir/uparse.log: uppltotf$(EXEEXT) uptftopl$(EXEEXT)
+uptexdir/gkhuge.log: uppltotf$(EXEEXT) uptftopl$(EXEEXT)
uptrip.diffs: uptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
$(triptrap_diffs) $@
.PHONY: uptrip-clean
diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog
index c9232f0c909..74db42062c7 100644
--- a/Build/source/texk/web2c/ptexdir/ChangeLog
+++ b/Build/source/texk/web2c/ptexdir/ChangeLog
@@ -1,3 +1,16 @@
+2018-02-02 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
+
+ * ppltotf.ch: Fix issues GitHub:texjporg/tex-jp-build#47, #48
+ - Support SKIP property in GLUEKERN table.
+ - Improve hex charcode parsing.
+ * ptftopl.ch: Fix issue GitHub:texjporg/tex-jp-build#48
+ - Print ASCII characters always in hex charcode (for upTFtoPL).
+ * ptex-base.ch: Fix issue GitHub:texjporg/tex-jp-build#47
+ - Support SKIP property in GLUEKERN table.
+ - Support huge GLUEKERN table with rearrangement.
+ * am/ptex.am: Add new tests.
+ * skipjfm.test, tests/skipjfm.{tex,pl,tfm}: New test files.
+
2018-01-31 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
* ptex-base.ch: Fix issue GitHub:texjporg/tex-jp-build#40
diff --git a/Build/source/texk/web2c/ptexdir/am/ptex.am b/Build/source/texk/web2c/ptexdir/am/ptex.am
index 77864e61c02..eccef3f920c 100644
--- a/Build/source/texk/web2c/ptexdir/am/ptex.am
+++ b/Build/source/texk/web2c/ptexdir/am/ptex.am
@@ -1,5 +1,6 @@
## texk/web2c/ptexdir/am/ptex.am: Makefile fragment for pTeX.
##
+## Copyright (C) 2016-2018 Karl Berry <tex-live@tug.org>
## Copyright (C) 2010-2015 Peter Breitenlohner <tex-live@tug.org>
## You may freely use, modify and/or distribute this file.
@@ -177,12 +178,14 @@ pweb_tests += ptexdir/pbibtex-openout-test.pl ptexdir/pbibtex-longline-test.pl
pweb_tests += ptexdir/pbibtex-mem.test ptexdir/nissya.test
pweb_tests += ptexdir/sample.test
pweb_tests += ptexdir/yokotate.test
+pweb_tests += ptexdir/skipjfmp.test
ptexdir/pbibtex.log ptexdir/pbibtex-openout-test.log ptexdir/pbibtex-longline-test.log \
ptexdir/pbibtex-mem.log ptexdir/nissya.log: pbibtex$(EXEEXT)
ptexdir/pdvitype.log ptexdir/sample.log: pdvitype$(EXEEXT)
ptexdir/ppltotf.log: ppltotf$(EXEEXT)
ptexdir/ptftopl.log: ptftopl$(EXEEXT)
ptexdir/yokotate.log: ppltotf$(EXEEXT) ptftopl$(EXEEXT)
+ptexdir/skipjfmp.log: ppltotf$(EXEEXT) ptftopl$(EXEEXT)
EXTRA_DIST += $(ptex_tests) $(pweb_tests)
DISTCLEANFILES += $(pweb_programs:=.c) $(pweb_programs:=.h) \
@@ -220,6 +223,9 @@ DISTCLEANFILES += ptests/xsample.typ
EXTRA_DIST += ptexdir/tests/min10.pl ptexdir/tests/min10.tfm
EXTRA_DIST += ptexdir/tests/tmin10.pl ptexdir/tests/tmin10.tfm
DISTCLEANFILES += ptests/x*min10.*
+## ptexdir/skipjfmp.test
+EXTRA_DIST += ptexdir/tests/skipjfmp.pl ptexdir/tests/skipjfmp.tfm
+DISTCLEANFILES += ptests/xskipjfmp.*
## ptexdir/ptriptest
EXTRA_DIST += ptexdir/ptrip/ptrip.diffs ptexdir/ptrip/texmf.cnf
ptrip.diffs: ptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
diff --git a/Build/source/texk/web2c/ptexdir/ppltotf.ch b/Build/source/texk/web2c/ptexdir/ppltotf.ch
index cb2d61ac258..edb61d7efa2 100644
--- a/Build/source/texk/web2c/ptexdir/ppltotf.ch
+++ b/Build/source/texk/web2c/ptexdir/ppltotf.ch
@@ -375,7 +375,8 @@ incr(current_option);
We need to include some routines for handling kanji characters.
@<Constants...@>=
-max_kanji=7237; { maximam number of 2byte characters }
+max_kanji=7237; { maximum number of 2byte characters }
+max_kanji_code=@"7E7E; { maximum jis code }
yoko_id_number=11; { is identifier for YOKO-kumi font}
tate_id_number=9; { is identifier for TATE-kumi font}
@@ -439,6 +440,7 @@ if cur_code=comment_code then skip_to_end_of_item
else begin case cur_code of
label_code:@<Read a glue label step@>;
stop_code:@<Read a stop step@>;
+ skip_code:@<Read a skip step@>;
krn_code:@<Read a (glue) kerning step@>;
glue_code:@<Read a glue step@>;
others:
@@ -683,11 +685,9 @@ if ch=')' then
begin decr(loc); jis_code:=0;
end
else if (ch='J')or(ch='j') then
- begin repeat ch:=get_next_raw; until ch<>' ';
- cx:=todig(xord[ch])*@"1000;
- incr(loc); ch:=xord[buffer[loc]]; cx:=cx+todig(ch)*@"100;
- incr(loc); ch:=xord[buffer[loc]]; cx:=cx+todig(ch)*@"10;
- incr(loc); ch:=xord[buffer[loc]]; cx:=cx+todig(ch);
+ begin repeat ch:=get_next_raw;
+ until ch<>' '; {skip the blanks after the type code}
+ @<Scan a Kanji hexadecimal code@>;
jis_code:=toDVI(fromJIS(cx)); cur_char:=ch;
if not valid_jis_code(jis_code) then
err_print('jis code ', jis_code:1, ' is invalid');
@@ -702,5 +702,19 @@ else jis_code:=-1;
get_kanji:=jis_code;
end;
+@ @<Scan a Kanji hex...@>=
+begin cx:=todig(xord[ch]);
+ incr(loc); ch:=xord[buffer[loc]];
+ while ((ch>="0")and(ch<="9"))or((ch>="A")and(ch<="F")) do
+ begin cx:=cx*16+todig(ch); {overflow might happen, but rare...}
+ incr(loc); ch:=xord[buffer[loc]];
+ end;
+ decr(loc); ch:=xord[buffer[loc]];
+ if cx>max_kanji_code then
+ begin skip_error('This value shouldn''t exceed jis code');
+ cx:=0; ch:=" ";
+ end;
+end
+
@* Index.
@z
diff --git a/Build/source/texk/web2c/ptexdir/ptex-base.ch b/Build/source/texk/web2c/ptexdir/ptex-base.ch
index 38b3b57e529..17e55d7065a 100644
--- a/Build/source/texk/web2c/ptexdir/ptex-base.ch
+++ b/Build/source/texk/web2c/ptexdir/ptex-base.ch
@@ -2708,10 +2708,15 @@ in the |glue_kern| array. And a \.{JFM} does not use |tag=2| and |tag=3|.
@x [30.557] l.11413 - pTeX: glue_kern_start
@d lig_kern_start(#)==lig_kern_base[#]+rem_byte {beginning of lig/kern program}
+@d lig_kern_restart_end(#)==256*op_byte(#)+rem_byte(#)+32768-kern_base_offset
+@d lig_kern_restart(#)==lig_kern_base[#]+lig_kern_restart_end
@y
@d lig_kern_start(#)==lig_kern_base[#]+rem_byte {beginning of lig/kern program}
-@d glue_kern_start(#)==lig_kern_base[#]+rem_byte
- {beginning of glue/kern program}
+@d lig_kern_restart_end(#)==256*op_byte(#)+rem_byte(#)+32768-kern_base_offset
+@d lig_kern_restart(#)==lig_kern_base[#]+lig_kern_restart_end
+@d glue_kern_start(#)==lig_kern_base[#]+rem_byte {beginning of glue/kern program}
+@d glue_kern_restart_end(#)==256*op_byte(#)+rem_byte(#)+32768-kern_base_offset
+@d glue_kern_restart(#)==lig_kern_base[#]+glue_kern_restart_end
@z
@x [30.560] l.11457 - pTeX: jfm_flag, jfm_id, nt, cx
@@ -3928,9 +3933,13 @@ if (math_type(subscr(q))=empty)and(math_type(supscr(q))=empty)and@|
begin cur_c:=a; a:=glue_kern_start(cur_f)(cur_i);
{|cur_c|:=qi(|get_jfm_pos|(|math_kcode|(p),
|fam_fnt|(fam(nucleus(p))+|cur_size|)));}
- repeat
cur_i:=font_info[a].qqqq;
- if next_char(cur_i)=cur_c then
+ if skip_byte(cur_i)>stop_flag then {huge glue/kern table rearranged}
+ begin a:=glue_kern_restart(cur_f)(cur_i);
+ cur_i:=font_info[a].qqqq;
+ end;
+ loop@+ begin
+ if next_char(cur_i)=cur_c then if skip_byte(cur_i)<=stop_flag then
if op_byte(cur_i)<kern_flag then
begin gp:=font_glue[cur_f]; rr:=rem_byte(cur_i);
if gp<>null then begin
@@ -3953,8 +3962,10 @@ if (math_type(subscr(q))=empty)and(math_type(supscr(q))=empty)and@|
else begin p:=new_kern(char_kern(cur_f)(cur_i));
link(p):=link(q); link(q):=p; return;
end;
- incr(a);
- until skip_byte(cur_i)>=stop_flag;
+ if skip_byte(cur_i)>=stop_flag then return;
+ a:=a+qo(skip_byte(cur_i))+1; {SKIP property}
+ cur_i:=font_info[a].qqqq;
+ end;
end;
end;
end;
@@ -7223,8 +7234,12 @@ if inhibit_glue_flag<>true then
goto skip_loop
else begin if char_tag(main_i)=gk_tag then
begin main_k:=glue_kern_start(main_f)(main_i);
- repeat main_j:=font_info[main_k].qqqq;
- if next_char(main_j)=cur_l then
+ main_j:=font_info[main_k].qqqq;
+ if skip_byte(main_j)>stop_flag then {huge glue/kern table rearranged}
+ begin main_k:=glue_kern_restart(main_f)(main_j);
+ main_j:=font_info[main_k].qqqq;
+ end;
+ loop@+begin if next_char(main_j)=cur_l then if skip_byte(main_j)<=stop_flag then
begin if op_byte(main_j)<kern_flag then
begin gp:=font_glue[main_f]; cur_r:=rem_byte(main_j);
if gp<>null then
@@ -7253,8 +7268,10 @@ if inhibit_glue_flag<>true then
goto skip_loop;
end;
end;
- incr(main_k);
- until skip_byte(main_j)>=stop_flag;
+ if skip_byte(main_j)>=stop_flag then goto skip_loop;
+ main_k:=main_k+qo(skip_byte(main_j))+1; {SKIP property}
+ main_j:=font_info[main_k].qqqq;
+ end;
end;
end;
end;
diff --git a/Build/source/texk/web2c/ptexdir/ptftopl.ch b/Build/source/texk/web2c/ptexdir/ptftopl.ch
index 97e670d78db..0aeb371f5a5 100644
--- a/Build/source/texk/web2c/ptexdir/ptftopl.ch
+++ b/Build/source/texk/web2c/ptexdir/ptftopl.ch
@@ -495,7 +495,7 @@ procedure out_kanji(jis_code:integer); { prints a kanji character }
var @!cx:integer; {KANJI code}
i:0..3; {index of array}
begin@/
-if charcode_format=charcode_octal then
+if (charcode_format=charcode_octal)or(jis_code<128) then
begin cx:=jis_code; out('J '); {specify jiscode format}
dig[0]:=Hi(cx) div 16; dig[1]:=Hi(cx) mod 16;
dig[2]:=Lo(cx) div 16; dig[3]:=Lo(cx) mod 16;
diff --git a/Build/source/texk/web2c/ptexdir/skipjfmp.test b/Build/source/texk/web2c/ptexdir/skipjfmp.test
new file mode 100755
index 00000000000..3b2e3ec7e0b
--- /dev/null
+++ b/Build/source/texk/web2c/ptexdir/skipjfmp.test
@@ -0,0 +1,22 @@
+#! /bin/sh -vx
+# $Id$
+# Copyright 2018 Karl Berry <tex-live@tug.org>
+# You may freely use, modify and/or distribute this file.
+
+test -d ptests || mkdir -p ptests
+
+# Test inputs
+testdir=$srcdir/ptexdir/tests
+
+# Testing pPLtoTF/pTFtoPL for SKIP property in GLUEKERN.
+for font in skipjfmp; do
+
+ ./ppltotf -verbose $testdir/$font.pl ptests/x$font.tfm && \
+ cmp $testdir/$font.tfm ptests/x$font.tfm && echo || exit 1
+
+ TEXMFCNF=$srcdir/../kpathsea \
+ ./ptftopl -charcode-format octal -verbose $testdir/$font.tfm ptests/x$font.pl && \
+ diff $testdir/$font.pl ptests/x$font.pl && echo || exit 1
+
+done
+
diff --git a/Build/source/texk/web2c/ptexdir/tests/skipjfmp.pl b/Build/source/texk/web2c/ptexdir/tests/skipjfmp.pl
new file mode 100644
index 00000000000..3d5f0bff790
--- /dev/null
+++ b/Build/source/texk/web2c/ptexdir/tests/skipjfmp.pl
@@ -0,0 +1,159 @@
+(COMMENT THIS IS A KANJI FORMAT FILE)
+(FAMILY JFM SKIP)
+(FACE F MRR)
+(CODINGSCHEME TEX KANJI TEXT)
+(DESIGNSIZE R 10.0)
+(COMMENT DESIGNSIZE IS IN POINTS)
+(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)
+(CHECKSUM O 0)
+(FONTDIMEN
+ (SLANT R 0.0)
+ (SPACE R 0.0)
+ (STRETCH R 0.1)
+ (SHRINK R 0.0)
+ (XHEIGHT R 1.0)
+ (QUAD R 1.0)
+ (EXTRASPACE R 0.25)
+ (EXTRASTRETCH R 0.2)
+ (EXTRASHRINK R 0.125)
+ )
+(GLUEKERN
+ (LABEL O 0)
+ (GLUE O 1 R 0.5 R 0.0 R 0.0)
+ (GLUE O 2 R 0.5 R 0.0 R 0.01)
+ (GLUE O 6 R 0.5 R 0.0 R 0.02)
+ (GLUE O 3 R 0.25 R 0.0 R 0.03)
+ (GLUE O 4 R 0.25 R 0.0 R 0.04)
+ (STOP)
+ (LABEL O 1)
+ (GLUE O 4 R 0.25 R 0.0 R 0.05)
+ (SKIP D 19)
+ (LABEL O 2)
+ (GLUE O 3 R 0.25 R 0.0 R 0.06)
+ (SKIP D 16)
+ (LABEL O 3)
+ (GLUE O 1 R 0.25 R 0.0 R 0.07)
+ (GLUE O 2 R 0.25 R 0.0 R 0.08)
+ (GLUE O 6 R 0.25 R 0.0 R 0.09)
+ (GLUE O 0 R 0.25 R 0.0 R 0.1)
+ (SKIP D 4)
+ (LABEL O 4)
+ (GLUE O 0 R 0.25 R 0.0 R 0.11)
+ (GLUE O 1 R 0.25 R 0.0 R 0.12)
+ (GLUE O 2 R 0.25 R 0.0 R 0.13)
+ (GLUE O 6 R 0.25 R 0.0 R 0.14)
+ (GLUE O 3 R 0.5 R 0.0 R 0.15)
+ (GLUE O 4 R 0.5 R 0.0 R 0.16)
+ (GLUE O 5 R 0.25 R 0.0 R 0.17)
+ (STOP)
+ (LABEL O 5)
+ (KRN O 5 R 0.0)
+ (GLUE O 1 R 0.5 R 0.0 R 0.18)
+ (GLUE O 2 R 0.5 R 0.0 R 0.19)
+ (GLUE O 6 R 0.5 R 0.0 R 0.2)
+ (GLUE O 3 R 0.25 R 0.0 R 0.21)
+ (GLUE O 4 R 0.25 R 0.0 R 0.22)
+ (STOP)
+ (LABEL O 6)
+ (GLUE O 4 R 0.25 R 0.0 R 0.23)
+ (GLUE O 3 R 0.25 R 0.0 R 0.24)
+ (STOP)
+ )
+(CHARSINTYPE O 1
+ J 214A
+ )
+(CHARSINTYPE O 2
+ J 2156
+ )
+(CHARSINTYPE O 3
+ J 2127
+ )
+(CHARSINTYPE O 4
+ J 2128
+ )
+(CHARSINTYPE O 5
+ J 2144
+ )
+(CHARSINTYPE O 6
+ J 215A
+ )
+(TYPE O 0
+ (CHARWD R 1.0)
+ (CHARHT R 0.88)
+ (CHARDP R 0.12)
+ (COMMENT
+ (GLUE O 1 R 0.5 R 0.0 R 0.0)
+ (GLUE O 2 R 0.5 R 0.0 R 0.01)
+ (GLUE O 6 R 0.5 R 0.0 R 0.02)
+ (GLUE O 3 R 0.25 R 0.0 R 0.03)
+ (GLUE O 4 R 0.25 R 0.0 R 0.04)
+ )
+ )
+(TYPE O 1
+ (CHARWD R 0.5)
+ (CHARHT R 0.88)
+ (CHARDP R 0.12)
+ (COMMENT
+ (GLUE O 4 R 0.25 R 0.0 R 0.05)
+ (GLUE O 3 R 0.25 R 0.0 R 0.24)
+ )
+ )
+(TYPE O 2
+ (CHARWD R 0.5)
+ (CHARHT R 0.88)
+ (CHARDP R 0.12)
+ (COMMENT
+ (GLUE O 3 R 0.25 R 0.0 R 0.06)
+ (GLUE O 4 R 0.25 R 0.0 R 0.22)
+ )
+ )
+(TYPE O 3
+ (CHARWD R 0.5)
+ (CHARHT R 0.88)
+ (CHARDP R 0.12)
+ (COMMENT
+ (GLUE O 1 R 0.25 R 0.0 R 0.07)
+ (GLUE O 2 R 0.25 R 0.0 R 0.08)
+ (GLUE O 6 R 0.25 R 0.0 R 0.09)
+ (GLUE O 0 R 0.25 R 0.0 R 0.1)
+ (GLUE O 3 R 0.5 R 0.0 R 0.15)
+ (GLUE O 4 R 0.5 R 0.0 R 0.16)
+ (GLUE O 5 R 0.25 R 0.0 R 0.17)
+ )
+ )
+(TYPE O 4
+ (CHARWD R 0.5)
+ (CHARHT R 0.88)
+ (CHARDP R 0.12)
+ (COMMENT
+ (GLUE O 0 R 0.25 R 0.0 R 0.11)
+ (GLUE O 1 R 0.25 R 0.0 R 0.12)
+ (GLUE O 2 R 0.25 R 0.0 R 0.13)
+ (GLUE O 6 R 0.25 R 0.0 R 0.14)
+ (GLUE O 3 R 0.5 R 0.0 R 0.15)
+ (GLUE O 4 R 0.5 R 0.0 R 0.16)
+ (GLUE O 5 R 0.25 R 0.0 R 0.17)
+ )
+ )
+(TYPE O 5
+ (CHARWD R 1.0)
+ (CHARHT R 0.88)
+ (CHARDP R 0.12)
+ (COMMENT
+ (KRN O 5 R 0.0)
+ (GLUE O 1 R 0.5 R 0.0 R 0.18)
+ (GLUE O 2 R 0.5 R 0.0 R 0.19)
+ (GLUE O 6 R 0.5 R 0.0 R 0.2)
+ (GLUE O 3 R 0.25 R 0.0 R 0.21)
+ (GLUE O 4 R 0.25 R 0.0 R 0.22)
+ )
+ )
+(TYPE O 6
+ (CHARWD R 0.5)
+ (CHARHT R 0.88)
+ (CHARDP R 0.12)
+ (COMMENT
+ (GLUE O 4 R 0.25 R 0.0 R 0.23)
+ (GLUE O 3 R 0.25 R 0.0 R 0.24)
+ )
+ )
diff --git a/Build/source/texk/web2c/ptexdir/tests/skipjfmp.tex b/Build/source/texk/web2c/ptexdir/tests/skipjfmp.tex
new file mode 100644
index 00000000000..274c5729bc9
--- /dev/null
+++ b/Build/source/texk/web2c/ptexdir/tests/skipjfmp.tex
@@ -0,0 +1,33 @@
+\prebreakpenalty`…=0
+\postbreakpenalty`「=0
+\postbreakpenalty`【=0
+\postbreakpenalty`(=0
+\postbreakpenalty`:=0
+\postbreakpenalty`;=0
+
+\tracingonline1
+\showboxdepth10000
+\showboxbreadth10000
+
+\font\x=jis\x
+\setbox0=\hbox{あ…あ「あ【あ(あ:あ;あ}\showbox0
+\box0
+
+\font\y=skipjfmp at 9.62216pt\y
+\setbox2=\hbox{あ…あ「あ【あ(あ:あ;あ}\showbox2
+\box2
+
+\newfam\mx
+\newfam\my
+\textfont\mx=\x \scriptfont\mx=\x \scriptscriptfont\mx=\x
+\textfont\my=\y \scriptfont\my=\y \scriptscriptfont\my=\y
+
+\jfam\mx
+\setbox4=\hbox{$あ…あ「あ【あ(あ:あ;あ$}\showbox4
+\box4
+
+\jfam\my
+\setbox6=\hbox{$あ…あ「あ【あ(あ:あ;あ$}\showbox6
+\box6
+
+\bye
diff --git a/Build/source/texk/web2c/ptexdir/tests/skipjfmp.tfm b/Build/source/texk/web2c/ptexdir/tests/skipjfmp.tfm
new file mode 100644
index 00000000000..1b6c4f18d07
--- /dev/null
+++ b/Build/source/texk/web2c/ptexdir/tests/skipjfmp.tfm
Binary files differ
diff --git a/Build/source/texk/web2c/uptexdir/ChangeLog b/Build/source/texk/web2c/uptexdir/ChangeLog
index 3f8f9a6f0dd..bf5cf6ccd8f 100644
--- a/Build/source/texk/web2c/uptexdir/ChangeLog
+++ b/Build/source/texk/web2c/uptexdir/ChangeLog
@@ -1,3 +1,10 @@
+2018-02-02 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
+
+ * uppltotf.ch: Adapt to changes in ptexdir/ppltotf.ch.
+ * am/uptex.am: Add new tests.
+ * gkhuge.test, tests/gkhuge.tex, tests/gkhuge{ok,ng}.tfm,
+ uparse.test, tests/uparse.{pl,tfm} : New test files.
+
2018-01-31 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
* uptex-m.ch: Adapt to changes in ptexdir/ptex-base.ch (disp_node).
diff --git a/Build/source/texk/web2c/uptexdir/am/uptex.am b/Build/source/texk/web2c/uptexdir/am/uptex.am
index 594d2cc2cb2..9c8c60de5d7 100644
--- a/Build/source/texk/web2c/uptexdir/am/uptex.am
+++ b/Build/source/texk/web2c/uptexdir/am/uptex.am
@@ -1,5 +1,6 @@
## texk/web2c/uptexdir/am/uptex.am: Makefile fragment for upTeX.
##
+## Copyright (C) 2016-2018 Karl Berry <tex-live@tug.org>
## Copyright (C) 2011-2015 Peter Breitenlohner <tex-live@tug.org>
## You may freely use, modify and/or distribute this file.
@@ -164,13 +165,17 @@ upweb_tests = \
uptexdir/uppltotf.test \
uptexdir/uptftopl.test \
uptexdir/yokotate.test \
- uptexdir/newjfm.test
+ uptexdir/newjfm.test \
+ uptexdir/uparse.test \
+ uptexdir/gkhuge.test
uptexdir/upbibtex.log: upbibtex$(EXEEXT)
uptexdir/updvitype.log: updvitype$(EXEEXT)
uptexdir/uppltotf.log: uppltotf$(EXEEXT)
uptexdir/uptftopl.log: uptftopl$(EXEEXT)
uptexdir/yokotate.log: uppltotf$(EXEEXT) uptftopl$(EXEEXT)
uptexdir/newjfm.log: uppltotf$(EXEEXT) uptftopl$(EXEEXT)
+uptexdir/uparse.log: uppltotf$(EXEEXT) uptftopl$(EXEEXT)
+uptexdir/gkhuge.log: uppltotf$(EXEEXT) uptftopl$(EXEEXT)
EXTRA_DIST += $(uptex_tests) $(upweb_tests)
DISTCLEANFILES += $(upweb_programs:=.c) $(upweb_programs:=.h) \
@@ -198,8 +203,16 @@ DISTCLEANFILES += uptests/xcmr10.pl
## uptexdir/yokotate.test
EXTRA_DIST += uptexdir/tests/umin10.pl uptexdir/tests/umin10.tfm
EXTRA_DIST += uptexdir/tests/utmin10.pl uptexdir/tests/utmin10.tfm
+DISTCLEANFILES += uptests/x*min10.*
+## uptexdir/newjfm.test
EXTRA_DIST += uptexdir/tests/testnewu.pl uptexdir/tests/testnewu.tfm
-DISTCLEANFILES += uptests/x*min10.* uptests/xtestnewu.*
+DISTCLEANFILES += uptests/xtestnewu.*
+## uptexdir/uparse.test
+EXTRA_DIST += uptexdir/tests/uparse.pl uptexdir/tests/uparse.tfm
+DISTCLEANFILES += uptests/*uparse.*
+## uptexdir/gkhuge.test
+EXTRA_DIST += uptexdir/tests/gkhugeok.tfm uptexdir/tests/gkhugeng.tfm
+DISTCLEANFILES += uptests/*gkhuge*.*
## uptexdir/uptriptest
EXTRA_DIST += uptexdir/uptrip/uptrip.diffs uptexdir/uptrip/texmf.cnf
uptrip.diffs: uptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
diff --git a/Build/source/texk/web2c/uptexdir/gkhuge.test b/Build/source/texk/web2c/uptexdir/gkhuge.test
new file mode 100755
index 00000000000..11c4758157b
--- /dev/null
+++ b/Build/source/texk/web2c/uptexdir/gkhuge.test
@@ -0,0 +1,36 @@
+#! /bin/sh -vx
+# $Id$
+# Copyright 2018 Karl Berry <tex-live@tug.org>
+# You may freely use, modify and/or distribute this file.
+
+test -d uptests || mkdir -p uptests
+
+# Test inputs
+testdir=$srcdir/uptexdir/tests
+
+# Testing upPLtoTF/upTFtoPL for huge GLUEKERN table
+# with rearrangement.
+for font in gkhugeok; do
+
+ # This test is constructed as a cycle, since JPL source
+ # of gkhugeok.tfm is so large.
+ TEXMFCNF=$srcdir/../kpathsea \
+ ./uptftopl -verbose $testdir/$font.tfm uptests/y$font.pl && \
+ ./uppltotf -verbose uptests/y$font.pl uptests/y$font.tfm && \
+ cmp $testdir/$font.tfm uptests/y$font.tfm && echo || exit 1
+
+done
+
+for font in gkhugeng; do
+
+ # Fifth byte of the JFM (= lf; length of the whole file)
+ # must not exceed 2^{15}-1; check that and exit with an
+ # error message, instead of trying to allocate too much.
+ # The invalid gkhugeng.tfm was erroneously created before
+ # web2c/pltotf.ch change 2017-09-10, due to overflow
+ TEXMFCNF=$srcdir/../kpathsea \
+ ./uptftopl -verbose $testdir/$font.tfm uptests/y$font.pl \
+ && exit 1 || echo
+
+done
+
diff --git a/Build/source/texk/web2c/uptexdir/tests/gkhuge.tex b/Build/source/texk/web2c/uptexdir/tests/gkhuge.tex
new file mode 100644
index 00000000000..744eb42672f
--- /dev/null
+++ b/Build/source/texk/web2c/uptexdir/tests/gkhuge.tex
@@ -0,0 +1,33 @@
+\prebreakpenalty`…=0
+\postbreakpenalty`「=0
+\postbreakpenalty`【=0
+\postbreakpenalty`(=0
+\postbreakpenalty`:=0
+\postbreakpenalty`;=0
+
+\tracingonline1
+\showboxdepth10000
+\showboxbreadth10000
+
+\font\x=upjisr-h\x
+\setbox0=\hbox{あ…あ「あ【あ(あ:あ;あ}\showbox0
+\box0
+
+\font\y=gkhugeok\y
+\setbox2=\hbox{あ…あ「あ【あ(あ:あ;あ}\showbox2
+\box2
+
+\newfam\mx
+\newfam\my
+\textfont\mx=\x \scriptfont\mx=\x \scriptscriptfont\mx=\x
+\textfont\my=\y \scriptfont\my=\y \scriptscriptfont\my=\y
+
+\jfam\mx
+\setbox4=\hbox{$あ…あ「あ【あ(あ:あ;あ$}\showbox4
+\box4
+
+\jfam\my
+\setbox6=\hbox{$あ…あ「あ【あ(あ:あ;あ$}\showbox6
+\box6
+
+\bye
diff --git a/Build/source/texk/web2c/uptexdir/tests/gkhugeng.tfm b/Build/source/texk/web2c/uptexdir/tests/gkhugeng.tfm
new file mode 100644
index 00000000000..60c13f00cbf
--- /dev/null
+++ b/Build/source/texk/web2c/uptexdir/tests/gkhugeng.tfm
Binary files differ
diff --git a/Build/source/texk/web2c/uptexdir/tests/gkhugeok.tfm b/Build/source/texk/web2c/uptexdir/tests/gkhugeok.tfm
new file mode 100644
index 00000000000..23c2a631d7f
--- /dev/null
+++ b/Build/source/texk/web2c/uptexdir/tests/gkhugeok.tfm
Binary files differ
diff --git a/Build/source/texk/web2c/uptexdir/tests/uparse.pl b/Build/source/texk/web2c/uptexdir/tests/uparse.pl
new file mode 100644
index 00000000000..906989df2f7
--- /dev/null
+++ b/Build/source/texk/web2c/uptexdir/tests/uparse.pl
@@ -0,0 +1,70 @@
+(FAMILY JFM UCODE)
+(FACE F MRR)
+(CODINGSCHEME TEX KANJI TEXT)
+(DESIGNSIZE R 10.0)
+(CHECKSUM O 0)
+(FONTDIMEN
+ (SLANT R 0.0)
+ (SPACE R 0.0)
+ (STRETCH R 0.1)
+ (SHRINK R 0.0)
+ (XHEIGHT R 1.0)
+ (QUAD R 1.0)
+ (EXTRASPACE R 0.25)
+ (EXTRASTRETCH R 0.2)
+ (EXTRASHRINK R 0.125)
+ )
+(GLUEKERN
+ (LABEL O 0)
+ (LABEL O 5)
+ (LABEL O 6)
+ (GLUE O 3 R 0.25 R 0.1 R 0.1)
+ (STOP)
+ (LABEL O 3)
+ (GLUE O 0 R 0.25 R 0.1 R 0.1)
+ (GLUE O 5 R 0.25 R 0.1 R 0.1)
+ (GLUE O 6 R 0.25 R 0.1 R 0.1)
+ (GLUE O 3 R 0.5 R 0.25 R 0.25)
+ (STOP)
+ )
+(CHARSINTYPE O 1 U A1)
+(CHARSINTYPE O 2 U 28)
+(CHARSINTYPE O 3 U B7)
+(CHARSINTYPE O 4 U 21)
+(CHARSINTYPE O 5 U 200B7)
+(CHARSINTYPE O 6 U 3042)
+(TYPE O 0
+ (CHARWD R 1.0)
+ (CHARHT R 0.88)
+ (CHARDP R 0.12)
+ )
+(TYPE O 1
+ (CHARWD R 0.5)
+ (CHARHT R 0.88)
+ (CHARDP R 0.12)
+ )
+(TYPE O 2
+ (CHARWD R 0.3)
+ (CHARHT R 0.88)
+ (CHARDP R 0.12)
+ )
+(TYPE O 3
+ (CHARWD R 0.5)
+ (CHARHT R 0.88)
+ (CHARDP R 0.12)
+ )
+(TYPE O 4
+ (CHARWD R 0.5)
+ (CHARHT R 0.88)
+ (CHARDP R 0.12)
+ )
+(TYPE O 5
+ (CHARWD R 1.0)
+ (CHARHT R 0.88)
+ (CHARDP R 0.12)
+ )
+(TYPE O 6
+ (CHARWD R 1.0)
+ (CHARHT R 0.88)
+ (CHARDP R 0.12)
+ )
diff --git a/Build/source/texk/web2c/uptexdir/tests/uparse.tfm b/Build/source/texk/web2c/uptexdir/tests/uparse.tfm
new file mode 100644
index 00000000000..88d1ec39291
--- /dev/null
+++ b/Build/source/texk/web2c/uptexdir/tests/uparse.tfm
Binary files differ
diff --git a/Build/source/texk/web2c/uptexdir/uparse.test b/Build/source/texk/web2c/uptexdir/uparse.test
new file mode 100755
index 00000000000..a51e5945f82
--- /dev/null
+++ b/Build/source/texk/web2c/uptexdir/uparse.test
@@ -0,0 +1,31 @@
+#! /bin/sh -vx
+# $Id$
+# Copyright 2018 Karl Berry <tex-live@tug.org>
+# You may freely use, modify and/or distribute this file.
+
+test -d uptests || mkdir -p uptests
+
+# Test inputs
+testdir=$srcdir/uptexdir/tests
+
+# Testing upPLtoTF/upTFtoPL for JPL parsing
+# and direct charcter printing (without -charcode-format octal).
+for font in uparse; do
+
+ # allow hex kanji code with arbitary digits,
+ # no error for no trailing spaces.
+ ./uppltotf -verbose $testdir/$font.pl uptests/x$font.tfm && \
+ cmp $testdir/$font.tfm uptests/x$font.tfm && echo || exit 1
+
+ # upTFtoPL should always print ASCII characters in charcode format,
+ # even when -charcode-format octal is disabled; otherwise
+ # upPLtoTF cannot accept the resulting JPL file correctly.
+ # This test is constructed as a cycle, so that there is no
+ # non-ASCII character inside test case distribution.
+ TEXMFCNF=$srcdir/../kpathsea \
+ ./uptftopl -verbose $testdir/$font.tfm uptests/y$font.pl && \
+ ./uppltotf -verbose uptests/y$font.pl uptests/y$font.tfm && \
+ cmp $testdir/$font.tfm uptests/y$font.tfm && echo || exit 1
+
+done
+
diff --git a/Build/source/texk/web2c/uptexdir/uppltotf.ch b/Build/source/texk/web2c/uptexdir/uppltotf.ch
index 2b2fd2c9e2a..392c6e34be8 100644
--- a/Build/source/texk/web2c/uptexdir/uppltotf.ch
+++ b/Build/source/texk/web2c/uptexdir/uppltotf.ch
@@ -13,9 +13,11 @@
@z
@x
-max_kanji=7237; { maximam number of 2byte characters }
+max_kanji=7237; { maximum number of 2byte characters }
+max_kanji_code=@"7E7E; { maximum jis code }
@y
max_kanji=1114111; { maximam number of 2byte characters }
+max_kanji_code=@"10FFFF; { maximum ucs code }
@z
@x function get_next_raw
@@ -91,27 +93,10 @@ else if multistrlen(ustringcast(buffer), loc+2, loc)=2 then
incr(loc); cur_char:=" ";
@y
else if (ch='U')or(ch='u') then
- begin repeat ch:=get_next_raw; until ch<>' ';
- cx:=todig(xord[ch])*@"1000;
- incr(loc); ch:=xord[buffer[loc]]; cx:=cx+todig(ch)*@"100;
- incr(loc); ch:=xord[buffer[loc]]; cx:=cx+todig(ch)*@"10;
- incr(loc); ch:=xord[buffer[loc]]; cx:=cx+todig(ch);
- { Uxxxx done, following code supports Uxxxxx and Uxxxxxx }
- incr(loc); ch:=xord[buffer[loc]];
- if (ch<>' ') then begin {5th digit found, proceed}
- cx:=cx*@"10+todig(ch);
- incr(loc); ch:=xord[buffer[loc]];
- if (ch<>' ') then {6th digit found, proceed}
- cx:=cx*@"10+todig(ch)
- else begin {6th digit not found, recover}
- decr(loc); ch:=xord[buffer[loc]];
- end
- end
- else begin {5th digit not found, recover}
- decr(loc); ch:=xord[buffer[loc]];
- end;
- jis_code:=toDVI(fromUCS(cx));
- cur_char:=ch;
+ begin repeat ch:=get_next_raw;
+ until ch<>' '; {skip the blanks after the type code}
+ @<Scan a Kanji hexadecimal code@>;
+ jis_code:=toDVI(fromUCS(cx)); cur_char:=ch;
if not valid_jis_code(jis_code) then
err_print('jis code ', jis_code:1, ' is invalid');
end