texlive[46518] Build/source/texk/web2c: ptexdir, uptexdir: support

commits+hironobu at tug.org commits+hironobu at tug.org
Fri Feb 2 14:13:03 CET 2018


Revision: 46518
          http://tug.org/svn/texlive?view=revision&revision=46518
Author:   hironobu
Date:     2018-02-02 14:13:02 +0100 (Fri, 02 Feb 2018)
Log Message:
-----------
ptexdir, uptexdir: support SKIP property in GLUEKERN and rearrangement

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/Makefile.in
    trunk/Build/source/texk/web2c/ptexdir/ChangeLog
    trunk/Build/source/texk/web2c/ptexdir/am/ptex.am
    trunk/Build/source/texk/web2c/ptexdir/ppltotf.ch
    trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
    trunk/Build/source/texk/web2c/ptexdir/ptftopl.ch
    trunk/Build/source/texk/web2c/uptexdir/ChangeLog
    trunk/Build/source/texk/web2c/uptexdir/am/uptex.am
    trunk/Build/source/texk/web2c/uptexdir/uppltotf.ch

Added Paths:
-----------
    trunk/Build/source/texk/web2c/ptexdir/skipjfmp.test
    trunk/Build/source/texk/web2c/ptexdir/tests/skipjfmp.pl
    trunk/Build/source/texk/web2c/ptexdir/tests/skipjfmp.tex
    trunk/Build/source/texk/web2c/ptexdir/tests/skipjfmp.tfm
    trunk/Build/source/texk/web2c/uptexdir/gkhuge.test
    trunk/Build/source/texk/web2c/uptexdir/tests/gkhuge.tex
    trunk/Build/source/texk/web2c/uptexdir/tests/gkhugeng.tfm
    trunk/Build/source/texk/web2c/uptexdir/tests/gkhugeok.tfm
    trunk/Build/source/texk/web2c/uptexdir/tests/uparse.pl
    trunk/Build/source/texk/web2c/uptexdir/tests/uparse.tfm
    trunk/Build/source/texk/web2c/uptexdir/uparse.test

Modified: trunk/Build/source/texk/web2c/Makefile.in
===================================================================
--- trunk/Build/source/texk/web2c/Makefile.in	2018-02-02 05:43:46 UTC (rev 46517)
+++ trunk/Build/source/texk/web2c/Makefile.in	2018-02-02 13:13:02 UTC (rev 46518)
@@ -2388,6 +2388,7 @@
 	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 @@
 	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 @@
 	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 @@
 	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 @@
 	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/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/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

Modified: trunk/Build/source/texk/web2c/ptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2018-02-02 05:43:46 UTC (rev 46517)
+++ trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2018-02-02 13:13:02 UTC (rev 46518)
@@ -1,3 +1,16 @@
+2018-02-02  Hironobu Yamashita  <h.y.acetaminophen at 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 at yahoo.co.jp>
 
 	* ptex-base.ch: Fix issue GitHub:texjporg/tex-jp-build#40

Modified: trunk/Build/source/texk/web2c/ptexdir/am/ptex.am
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/am/ptex.am	2018-02-02 05:43:46 UTC (rev 46517)
+++ trunk/Build/source/texk/web2c/ptexdir/am/ptex.am	2018-02-02 13:13:02 UTC (rev 46518)
@@ -1,5 +1,6 @@
 ## texk/web2c/ptexdir/am/ptex.am: Makefile fragment for pTeX.
 ##
+## Copyright (C) 2016-2018 Karl Berry <tex-live at tug.org>
 ## Copyright (C) 2010-2015 Peter Breitenlohner <tex-live at tug.org>
 ## You may freely use, modify and/or distribute this file.
 
@@ -177,6 +178,7 @@
 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)
@@ -183,6 +185,7 @@
 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 @@
 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)

Modified: trunk/Build/source/texk/web2c/ptexdir/ppltotf.ch
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ppltotf.ch	2018-02-02 05:43:46 UTC (rev 46517)
+++ trunk/Build/source/texk/web2c/ptexdir/ppltotf.ch	2018-02-02 13:13:02 UTC (rev 46518)
@@ -375,7 +375,8 @@
 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 @@
 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 @@
   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 @@
 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

Modified: trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch	2018-02-02 05:43:46 UTC (rev 46517)
+++ trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch	2018-02-02 13:13:02 UTC (rev 46518)
@@ -2708,10 +2708,15 @@
 
 @x [30.557] l.11413 - pTeX: glue_kern_start
 @d lig_kern_start(#)==lig_kern_base[#]+rem_byte {beginning of lig/kern program}
+ at d lig_kern_restart_end(#)==256*op_byte(#)+rem_byte(#)+32768-kern_base_offset
+ at 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}
- at d glue_kern_start(#)==lig_kern_base[#]+rem_byte
-  {beginning of glue/kern program}
+ at d lig_kern_restart_end(#)==256*op_byte(#)+rem_byte(#)+32768-kern_base_offset
+ at d lig_kern_restart(#)==lig_kern_base[#]+lig_kern_restart_end
+ at d glue_kern_start(#)==lig_kern_base[#]+rem_byte {beginning of glue/kern program}
+ at d glue_kern_restart_end(#)==256*op_byte(#)+rem_byte(#)+32768-kern_base_offset
+ at 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 @@
         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 at + 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 @@
          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 @@
     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 at +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 @@
         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;

Modified: trunk/Build/source/texk/web2c/ptexdir/ptftopl.ch
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ptftopl.ch	2018-02-02 05:43:46 UTC (rev 46517)
+++ trunk/Build/source/texk/web2c/ptexdir/ptftopl.ch	2018-02-02 13:13:02 UTC (rev 46518)
@@ -495,7 +495,7 @@
 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;

Added: trunk/Build/source/texk/web2c/ptexdir/skipjfmp.test
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/skipjfmp.test	                        (rev 0)
+++ trunk/Build/source/texk/web2c/ptexdir/skipjfmp.test	2018-02-02 13:13:02 UTC (rev 46518)
@@ -0,0 +1,22 @@
+#! /bin/sh -vx
+# $Id$
+# Copyright 2018 Karl Berry <tex-live at 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
+


Property changes on: trunk/Build/source/texk/web2c/ptexdir/skipjfmp.test
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Build/source/texk/web2c/ptexdir/tests/skipjfmp.pl
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/tests/skipjfmp.pl	                        (rev 0)
+++ trunk/Build/source/texk/web2c/ptexdir/tests/skipjfmp.pl	2018-02-02 13:13:02 UTC (rev 46518)
@@ -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)
+      )
+   )


Property changes on: trunk/Build/source/texk/web2c/ptexdir/tests/skipjfmp.pl
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Build/source/texk/web2c/ptexdir/tests/skipjfmp.tex
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/tests/skipjfmp.tex	                        (rev 0)
+++ trunk/Build/source/texk/web2c/ptexdir/tests/skipjfmp.tex	2018-02-02 13:13:02 UTC (rev 46518)
@@ -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


Property changes on: trunk/Build/source/texk/web2c/ptexdir/tests/skipjfmp.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Build/source/texk/web2c/ptexdir/tests/skipjfmp.tfm
===================================================================
(Binary files differ)

Index: trunk/Build/source/texk/web2c/ptexdir/tests/skipjfmp.tfm
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/tests/skipjfmp.tfm	2018-02-02 05:43:46 UTC (rev 46517)
+++ trunk/Build/source/texk/web2c/ptexdir/tests/skipjfmp.tfm	2018-02-02 13:13:02 UTC (rev 46518)

Property changes on: trunk/Build/source/texk/web2c/ptexdir/tests/skipjfmp.tfm
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Modified: trunk/Build/source/texk/web2c/uptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/ChangeLog	2018-02-02 05:43:46 UTC (rev 46517)
+++ trunk/Build/source/texk/web2c/uptexdir/ChangeLog	2018-02-02 13:13:02 UTC (rev 46518)
@@ -1,3 +1,10 @@
+2018-02-02  Hironobu Yamashita  <h.y.acetaminophen at 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 at yahoo.co.jp>
 
 	* uptex-m.ch: Adapt to changes in ptexdir/ptex-base.ch (disp_node).

Modified: trunk/Build/source/texk/web2c/uptexdir/am/uptex.am
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/am/uptex.am	2018-02-02 05:43:46 UTC (rev 46517)
+++ trunk/Build/source/texk/web2c/uptexdir/am/uptex.am	2018-02-02 13:13:02 UTC (rev 46518)
@@ -1,5 +1,6 @@
 ## texk/web2c/uptexdir/am/uptex.am: Makefile fragment for upTeX.
 ##
+## Copyright (C) 2016-2018 Karl Berry <tex-live at tug.org>
 ## Copyright (C) 2011-2015 Peter Breitenlohner <tex-live at tug.org>
 ## You may freely use, modify and/or distribute this file.
 
@@ -164,7 +165,9 @@
 	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)
@@ -171,6 +174,8 @@
 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 @@
 ## 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)

Added: trunk/Build/source/texk/web2c/uptexdir/gkhuge.test
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/gkhuge.test	                        (rev 0)
+++ trunk/Build/source/texk/web2c/uptexdir/gkhuge.test	2018-02-02 13:13:02 UTC (rev 46518)
@@ -0,0 +1,36 @@
+#! /bin/sh -vx
+# $Id$
+# Copyright 2018 Karl Berry <tex-live at 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
+


Property changes on: trunk/Build/source/texk/web2c/uptexdir/gkhuge.test
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Build/source/texk/web2c/uptexdir/tests/gkhuge.tex
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/tests/gkhuge.tex	                        (rev 0)
+++ trunk/Build/source/texk/web2c/uptexdir/tests/gkhuge.tex	2018-02-02 13:13:02 UTC (rev 46518)
@@ -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


Property changes on: trunk/Build/source/texk/web2c/uptexdir/tests/gkhuge.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Build/source/texk/web2c/uptexdir/tests/gkhugeng.tfm
===================================================================
(Binary files differ)

Index: trunk/Build/source/texk/web2c/uptexdir/tests/gkhugeng.tfm
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/tests/gkhugeng.tfm	2018-02-02 05:43:46 UTC (rev 46517)
+++ trunk/Build/source/texk/web2c/uptexdir/tests/gkhugeng.tfm	2018-02-02 13:13:02 UTC (rev 46518)

Property changes on: trunk/Build/source/texk/web2c/uptexdir/tests/gkhugeng.tfm
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Build/source/texk/web2c/uptexdir/tests/gkhugeok.tfm
===================================================================
(Binary files differ)

Index: trunk/Build/source/texk/web2c/uptexdir/tests/gkhugeok.tfm
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/tests/gkhugeok.tfm	2018-02-02 05:43:46 UTC (rev 46517)
+++ trunk/Build/source/texk/web2c/uptexdir/tests/gkhugeok.tfm	2018-02-02 13:13:02 UTC (rev 46518)

Property changes on: trunk/Build/source/texk/web2c/uptexdir/tests/gkhugeok.tfm
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Build/source/texk/web2c/uptexdir/tests/uparse.pl
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/tests/uparse.pl	                        (rev 0)
+++ trunk/Build/source/texk/web2c/uptexdir/tests/uparse.pl	2018-02-02 13:13:02 UTC (rev 46518)
@@ -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)
+   )


Property changes on: trunk/Build/source/texk/web2c/uptexdir/tests/uparse.pl
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Build/source/texk/web2c/uptexdir/tests/uparse.tfm
===================================================================
(Binary files differ)

Index: trunk/Build/source/texk/web2c/uptexdir/tests/uparse.tfm
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/tests/uparse.tfm	2018-02-02 05:43:46 UTC (rev 46517)
+++ trunk/Build/source/texk/web2c/uptexdir/tests/uparse.tfm	2018-02-02 13:13:02 UTC (rev 46518)

Property changes on: trunk/Build/source/texk/web2c/uptexdir/tests/uparse.tfm
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Build/source/texk/web2c/uptexdir/uparse.test
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/uparse.test	                        (rev 0)
+++ trunk/Build/source/texk/web2c/uptexdir/uparse.test	2018-02-02 13:13:02 UTC (rev 46518)
@@ -0,0 +1,31 @@
+#! /bin/sh -vx
+# $Id$
+# Copyright 2018 Karl Berry <tex-live at 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
+


Property changes on: trunk/Build/source/texk/web2c/uptexdir/uparse.test
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Modified: trunk/Build/source/texk/web2c/uptexdir/uppltotf.ch
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/uppltotf.ch	2018-02-02 05:43:46 UTC (rev 46517)
+++ trunk/Build/source/texk/web2c/uptexdir/uppltotf.ch	2018-02-02 13:13:02 UTC (rev 46518)
@@ -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 @@
   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



More information about the tex-live-commits mailing list