summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHironobu Yamashita <h.y.acetaminophen@gmail.com>2018-01-27 02:23:14 +0000
committerHironobu Yamashita <h.y.acetaminophen@gmail.com>2018-01-27 02:23:14 +0000
commit5818288af5e420fda055a4d53fb22333a66cd7ad (patch)
tree7d3eef35c0853a1c06d4dda762ec17e63c24f81a
parent377d5b6a96e2b1ad97c691da9c9e3f187e51364a (diff)
ptexdir, uptexdir: introduce a new JFM spec
git-svn-id: svn://tug.org/texlive/trunk@46452 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/web2c/Makefile.in19
-rw-r--r--Build/source/texk/web2c/ptexdir/ChangeLog7
-rw-r--r--Build/source/texk/web2c/ptexdir/pdvitype.ch4
-rw-r--r--Build/source/texk/web2c/ptexdir/ppltotf.ch26
-rw-r--r--Build/source/texk/web2c/ptexdir/ptex-base.ch20
-rw-r--r--Build/source/texk/web2c/ptexdir/ptftopl.ch14
-rw-r--r--Build/source/texk/web2c/uptexdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/uptexdir/am/uptex.am7
-rwxr-xr-xBuild/source/texk/web2c/uptexdir/newjfm.test22
-rw-r--r--Build/source/texk/web2c/uptexdir/tests/testnewu.pl130
-rw-r--r--Build/source/texk/web2c/uptexdir/tests/testnewu.tfmbin0 -> 388 bytes
-rw-r--r--Build/source/texk/web2c/uptexdir/uppltotf.ch45
-rw-r--r--Build/source/texk/web2c/uptexdir/uptex-m.ch16
-rw-r--r--Build/source/texk/web2c/uptexdir/uptftopl.ch28
14 files changed, 294 insertions, 48 deletions
diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in
index 21f0b70794b..0f1ffc2b881 100644
--- a/Build/source/texk/web2c/Makefile.in
+++ b/Build/source/texk/web2c/Makefile.in
@@ -2402,6 +2402,7 @@ EXTRA_DIST = PROJECTS cftests cpascal.h help.h w2c/config.h \
uptexdir/ChangeLog $(uptex_tests) $(upweb_tests) \
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/uptrip/uptrip.diffs uptexdir/uptrip/texmf.cnf \
$(euptex_web_srcs) $(euptex_ch_srcs) euptexdir/euptex.defines \
euptexdir/COPYRIGHT euptexdir/COPYRIGHT.jis \
@@ -2692,13 +2693,13 @@ DISTCLEANFILES = CXXLD.sh tangle.c tangle.h tangle.p tangle-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.* 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.* 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 \
@@ -3248,7 +3249,8 @@ upweb_tests = \
uptexdir/updvitype.test \
uptexdir/uppltotf.test \
uptexdir/uptftopl.test \
- uptexdir/yokotate.test
+ uptexdir/yokotate.test \
+ uptexdir/newjfm.test
euptex_CPPFLAGS = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS) \
-I$(srcdir)/libmd5 $(am__append_139)
@@ -17551,6 +17553,7 @@ 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)
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 d4deadb2bd6..b185d6952fc 100644
--- a/Build/source/texk/web2c/ptexdir/ChangeLog
+++ b/Build/source/texk/web2c/ptexdir/ChangeLog
@@ -1,3 +1,10 @@
+2018-01-27 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
+
+ * ppltotf.ch, ptftopl.ch: Introduce a new JFM spec, to allow
+ 3-byte characters in TYPE > 0 for upTeX. The new spec is
+ effectively upper compatible with the original one.
+ * ptex-base.ch, pdvitype.ch: Adapt to the new JFM spec.
+
2018-01-21 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
* ptex-base.ch: New primitives: \ptexversion, \ptexminorversion
diff --git a/Build/source/texk/web2c/ptexdir/pdvitype.ch b/Build/source/texk/web2c/ptexdir/pdvitype.ch
index 7090b09a786..8ce48c12d6b 100644
--- a/Build/source/texk/web2c/ptexdir/pdvitype.ch
+++ b/Build/source/texk/web2c/ptexdir/pdvitype.ch
@@ -133,8 +133,8 @@ lh:=b2*256+b3;
for k:=1 to nt do
begin
read_tfm_word;
- jfm_char_code[jfm_char_type_count]:=b0*256+b1;
- jfm_char_type[jfm_char_type_count]:=b2*256+b3;
+ jfm_char_code[jfm_char_type_count]:=b0*256+b1+b2*65536;
+ jfm_char_type[jfm_char_type_count]:=b3;
jfm_char_font[jfm_char_type_count]:=nf;
jfm_h:= { hash value }
(jfm_char_code[jfm_char_type_count]+nf) mod jfm_hash_size;
diff --git a/Build/source/texk/web2c/ptexdir/ppltotf.ch b/Build/source/texk/web2c/ptexdir/ppltotf.ch
index a3bb0e3c48d..cb2d61ac258 100644
--- a/Build/source/texk/web2c/ptexdir/ppltotf.ch
+++ b/Build/source/texk/web2c/ptexdir/ppltotf.ch
@@ -1,5 +1,6 @@
% This is a change file for PLtoTF
%
+% (2018-01-27) HY pPLtoTF p2.0 - new JFM spec by texjporg
% (07/18/2006) ST PLtoTF p1.8 (3.5, Web2c 7.2)
% (11/13/2000) KN PLtoTF p1.4 (3.5, Web2c 7.2)
% (03/27/1998) KN PLtoTF p1.3 (3.5, Web2c 7.2)
@@ -15,7 +16,7 @@
@d banner=='This is PLtoTF, Version 3.6' {printed when the program starts}
@y
@d my_name=='ppltotf'
-@d banner=='This is pPLtoTF, Version 3.6-p1.8'
+@d banner=='This is pPLtoTF, Version 3.6-p2.0'
{printed when the program starts}
@z
@@ -230,6 +231,13 @@ else
memory[italic]+nl+lk_offset+nk+ne+np;
@z
+@x [131] pTeX:
+@ @d out_size(#)==out((#) div 256); out((#) mod 256)
+@y
+@ @d out_size(#)==out((#) div 256); out((#) mod 256)
+@d out_kanji_code(#)==out_size((#) mod 65536); out((#) div 65536)
+@z
+
@x [131] l.2256 - pTeX:
out_size(lf); out_size(lh); out_size(bc); out_size(ec);
out_size(memory[width]); out_size(memory[height]);
@@ -572,13 +580,23 @@ skip_to_paren;
end
@ Next codes used to write |kanji_type| to \.{JFM}.
+In the original JFM spec by ASCII Corporation, |jis_code| and |char_type|
+were packed into upper (2~bytes) and lower (2~bytes) halfword respectively.
+However, |char_type| is allowed only 0..255,
+so the upper byte of lower halfword was always 0.
+
+In the new JFM spec by texjporg, |jis_code| ``XXyyzz'' is packed into
+first 3~bytes in the form ``yy zz XX'', and |char_type| is packed into
+remaining 1~byte. The new spec is effectively upper compatible with
+the original, and it allows |jis_code| larger than 0x10000 (not really
+useful for me \.{pPLtoTF} but necessary for \.{upPLtoTF}).
@<Output the kanji character type info@>=
begin out_size(0); out_size(0); { the default }
for kanji_type_index:=0 to max_kanji do
begin if kanji_type[kanji_type_index]>0 then
- begin out_size(index_to_jis(kanji_type_index));
- out_size(kanji_type[kanji_type_index]);
+ begin out_kanji_code(index_to_jis(kanji_type_index));
+ out(kanji_type[kanji_type_index]);
if verbose then begin
print('char index = ', kanji_type_index);
print(' (jis ');
@@ -616,7 +634,7 @@ else begin skip_error('This expression is out of JIS-code encoding.');
end;
@#
procedure print_jis_hex(jis_code:integer); {prints jiscode as four digits}
-var dig:array[0..4] of byte; {holds jis hex codes}
+var dig:array[0..3] of byte; {holds jis hex codes}
i:byte; {index of array}
begin dig[0]:=Hi(jis_code) div 16; dig[1]:=Hi(jis_code) mod 16;
dig[2]:=Lo(jis_code) div 16; dig[3]:=Lo(jis_code) mod 16;
diff --git a/Build/source/texk/web2c/ptexdir/ptex-base.ch b/Build/source/texk/web2c/ptexdir/ptex-base.ch
index 9e77bf35372..61797a5123b 100644
--- a/Build/source/texk/web2c/ptexdir/ptex-base.ch
+++ b/Build/source/texk/web2c/ptexdir/ptex-base.ch
@@ -2720,6 +2720,22 @@ var k:font_index; {index into |font_info|}
@!cx:KANJI_code; {kanji code}
@z
+@x
+@d read_sixteen(#)==begin #:=fbyte;
+ if #>127 then abort;
+ fget; #:=#*@'400+fbyte;
+ end
+@y
+@d read_sixteen(#)==begin #:=fbyte;
+ if #>127 then abort;
+ fget; #:=#*@'400+fbyte;
+ end
+@d read_twentyfourx(#)==begin #:=fbyte;
+ fget; #:=#*@"100+fbyte;
+ fget; #:=#+fbyte*@"10000;
+ end
+@z
+
@x [30.565] l.11548 - pTeX: read tfm size
@ @<Read the {\.{TFM}} size fields@>=
begin read_sixteen(lf);
@@ -2830,8 +2846,8 @@ for k:=fmem_ptr to width_base[f]-1 do
if jfm_flag<>dir_default then
for k:=ctype_base[f] to ctype_base[f]+nt-1 do
begin
- fget; read_sixteen(cx); font_info[k].hh.rh:=tokanji(cx); {|kchar_code|}
- fget; read_sixteen(cx); font_info[k].hh.lhfield:=tonum(cx); {|kchar_type|}
+ fget; read_twentyfourx(cx); font_info[k].hh.rh:=tokanji(cx); {|kchar_code|}
+ fget; cx:=fbyte; font_info[k].hh.lhfield:=tonum(cx); {|kchar_type|}
end;
for k:=char_base[f]+bc to width_base[f]-1 do
begin store_four_quarters(font_info[k].qqqq);
diff --git a/Build/source/texk/web2c/ptexdir/ptftopl.ch b/Build/source/texk/web2c/ptexdir/ptftopl.ch
index c9c08c0588a..97e670d78db 100644
--- a/Build/source/texk/web2c/ptexdir/ptftopl.ch
+++ b/Build/source/texk/web2c/ptexdir/ptftopl.ch
@@ -1,5 +1,6 @@
% This is a change file for TFtoPL
%
+% (2018-01-27) HY pTFtoPL p2.0 - new JFM spec by texjporg
% (07/18/2006) ST TFtoPL p1.7 (3.1, Web2c 7.2)
% (03/27/1998) KN TFtoPL p1.4 (3.1, Web2c 7.2)
%
@@ -14,7 +15,7 @@
@d banner=='This is TFtoPL, Version 3.3' {printed when the program starts}
@y
@d my_name=='ptftopl'
-@d banner=='This is pTFtoPL, Version 3.3-p1.7'
+@d banner=='This is pTFtoPL, Version 3.3-p2.0'
{printed when the program starts}
@z
@@ -437,11 +438,12 @@ else
end;
end
-@ list the |char_type| table in a similar way to the type table
+@ list the |char_type| table in a similar way to the type table.
+The code is based on the new JFM spec by texjporg.
@d char_type(#)==4*(type_base+#) {here \#\ is an index, not a character}
-@d JIS_code(#)==tfm[char_type(#)+0]*@'400+tfm[char_type(#)+1] {JIS code from |char_type| table}
-@d JIS_type(#)==tfm[char_type(#)+2]*@'400+tfm[char_type(#)+3] {JIS type from |char_type| table}
+@d JIS_code(#)==tfm[char_type(#)+0]*@'400+tfm[char_type(#)+1]+tfm[char_type(#)+2]*@'400*@'400 {JIS code from |char_type| table}
+@d JIS_type(#)==tfm[char_type(#)+3] {JIS type from |char_type| table}
@<list |char_type| table@>=
this_code:=JIS_code(0);
@@ -475,7 +477,7 @@ for type_num:=1 to ec do
incr(type_count);
out_kanji(index_to_jis(kanji_index));
end;
- if type_count=0 then bad('type ', type_num:1, 'has no characters in it!');
+ if type_count=0 then bad('type ', type_num:1, ' has no characters in it!');
out_ln; right;
end;
@@ -491,7 +493,7 @@ for k:=@'40 to 255 do xchr[k]:=k;
@ @<declare kanji conversion functions@>=
procedure out_kanji(jis_code:integer); { prints a kanji character }
var @!cx:integer; {KANJI code}
-i:0..4; {index of array}
+i:0..3; {index of array}
begin@/
if charcode_format=charcode_octal then
begin cx:=jis_code; out('J '); {specify jiscode format}
diff --git a/Build/source/texk/web2c/uptexdir/ChangeLog b/Build/source/texk/web2c/uptexdir/ChangeLog
index 74224a65505..13f750da587 100644
--- a/Build/source/texk/web2c/uptexdir/ChangeLog
+++ b/Build/source/texk/web2c/uptexdir/ChangeLog
@@ -1,3 +1,7 @@
+2018-01-27 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
+
+ * uppltotf.ch, uptftopl.ch, uptex-m.ch: Adapt to the new JFM spec.
+
2018-01-21 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
* yokotate.test, tests/{,u}[,t]min10.[pl,tfm], am/uptex.am:
diff --git a/Build/source/texk/web2c/uptexdir/am/uptex.am b/Build/source/texk/web2c/uptexdir/am/uptex.am
index d2a6ae52abb..594d2cc2cb2 100644
--- a/Build/source/texk/web2c/uptexdir/am/uptex.am
+++ b/Build/source/texk/web2c/uptexdir/am/uptex.am
@@ -163,12 +163,14 @@ upweb_tests = \
uptexdir/updvitype.test \
uptexdir/uppltotf.test \
uptexdir/uptftopl.test \
- uptexdir/yokotate.test
+ uptexdir/yokotate.test \
+ uptexdir/newjfm.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)
EXTRA_DIST += $(uptex_tests) $(upweb_tests)
DISTCLEANFILES += $(upweb_programs:=.c) $(upweb_programs:=.h) \
@@ -196,7 +198,8 @@ 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.*
+EXTRA_DIST += uptexdir/tests/testnewu.pl uptexdir/tests/testnewu.tfm
+DISTCLEANFILES += uptests/x*min10.* uptests/xtestnewu.*
## 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/newjfm.test b/Build/source/texk/web2c/uptexdir/newjfm.test
new file mode 100755
index 00000000000..3240dad835e
--- /dev/null
+++ b/Build/source/texk/web2c/uptexdir/newjfm.test
@@ -0,0 +1,22 @@
+#! /bin/sh -vx
+# $Id: newjfm.test 46400 2018-01-21 05:26:27Z hironobu $
+# 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 new JFM spec by texjporg.
+for font in testnewu; do
+
+ ./uppltotf -verbose $testdir/$font.pl uptests/x$font.tfm && \
+ cmp $testdir/$font.tfm uptests/x$font.tfm && echo || exit 1
+
+ TEXMFCNF=$srcdir/../kpathsea \
+ ./uptftopl -charcode-format octal -verbose $testdir/$font.tfm uptests/x$font.pl && \
+ diff $testdir/$font.pl uptests/x$font.pl && echo || exit 1
+
+done
+
diff --git a/Build/source/texk/web2c/uptexdir/tests/testnewu.pl b/Build/source/texk/web2c/uptexdir/tests/testnewu.pl
new file mode 100644
index 00000000000..6b211cd51aa
--- /dev/null
+++ b/Build/source/texk/web2c/uptexdir/tests/testnewu.pl
@@ -0,0 +1,130 @@
+(COMMENT THIS IS A KANJI FORMAT FILE)
+(FAMILY UPJIS KANJI)
+(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.5)
+ (GLUE O 3 R 0.25 R 0.0 R 0.25)
+ (STOP)
+ (LABEL O 1)
+ (GLUE O 3 R 0.25 R 0.0 R 0.25)
+ (STOP)
+ (LABEL O 2)
+ (GLUE O 0 R 0.5 R 0.0 R 0.5)
+ (GLUE O 1 R 0.5 R 0.0 R 0.5)
+ (GLUE O 3 R 0.25 R 0.0 R 0.25)
+ (GLUE O 5 R 0.5 R 0.0 R 0.5)
+ (STOP)
+ (LABEL O 3)
+ (GLUE O 0 R 0.25 R 0.0 R 0.25)
+ (GLUE O 1 R 0.25 R 0.0 R 0.25)
+ (GLUE O 2 R 0.25 R 0.0 R 0.25)
+ (GLUE O 3 R 0.5 R 0.0 R 0.25)
+ (GLUE O 4 R 0.25 R 0.0 R 0.25)
+ (GLUE O 5 R 0.25 R 0.0 R 0.25)
+ (STOP)
+ (LABEL O 4)
+ (GLUE O 0 R 0.5 R 0.0 R 0.0)
+ (GLUE O 1 R 0.5 R 0.0 R 0.0)
+ (GLUE O 3 R 0.75 R 0.0 R 0.25)
+ (GLUE O 5 R 0.5 R 0.0 R 0.0)
+ (STOP)
+ (LABEL O 5)
+ (GLUE O 1 R 0.5 R 0.0 R 0.5)
+ (GLUE O 3 R 0.25 R 0.0 R 0.25)
+ (KRN O 5 R 0.0)
+ (STOP)
+ )
+(CHARSINTYPE O 1
+ U 81FC U FF08 U 26951
+ )
+(CHARSINTYPE O 2
+ U 5409 U FF09 U 20BB7
+ )
+(CHARSINTYPE O 3
+ U 2462 U FF1A
+ )
+(CHARSINTYPE O 4
+ U 2463 U 3002
+ )
+(CHARSINTYPE O 5
+ U 2026 U 2464
+ )
+(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.5)
+ (GLUE O 3 R 0.25 R 0.0 R 0.25)
+ )
+ )
+(TYPE O 1
+ (CHARWD R 0.5)
+ (CHARHT R 0.88)
+ (CHARDP R 0.12)
+ (COMMENT
+ (GLUE O 3 R 0.25 R 0.0 R 0.25)
+ )
+ )
+(TYPE O 2
+ (CHARWD R 0.5)
+ (CHARHT R 0.88)
+ (CHARDP R 0.12)
+ (COMMENT
+ (GLUE O 0 R 0.5 R 0.0 R 0.5)
+ (GLUE O 1 R 0.5 R 0.0 R 0.5)
+ (GLUE O 3 R 0.25 R 0.0 R 0.25)
+ (GLUE O 5 R 0.5 R 0.0 R 0.5)
+ )
+ )
+(TYPE O 3
+ (CHARWD R 0.5)
+ (CHARHT R 0.88)
+ (CHARDP R 0.12)
+ (COMMENT
+ (GLUE O 0 R 0.25 R 0.0 R 0.25)
+ (GLUE O 1 R 0.25 R 0.0 R 0.25)
+ (GLUE O 2 R 0.25 R 0.0 R 0.25)
+ (GLUE O 3 R 0.5 R 0.0 R 0.25)
+ (GLUE O 4 R 0.25 R 0.0 R 0.25)
+ (GLUE O 5 R 0.25 R 0.0 R 0.25)
+ )
+ )
+(TYPE O 4
+ (CHARWD R 0.5)
+ (CHARHT R 0.88)
+ (CHARDP R 0.12)
+ (COMMENT
+ (GLUE O 0 R 0.5 R 0.0 R 0.0)
+ (GLUE O 1 R 0.5 R 0.0 R 0.0)
+ (GLUE O 3 R 0.75 R 0.0 R 0.25)
+ (GLUE O 5 R 0.5 R 0.0 R 0.0)
+ )
+ )
+(TYPE O 5
+ (CHARWD R 1.0)
+ (CHARHT R 0.88)
+ (CHARDP R 0.12)
+ (COMMENT
+ (GLUE O 1 R 0.5 R 0.0 R 0.5)
+ (GLUE O 3 R 0.25 R 0.0 R 0.25)
+ (KRN O 5 R 0.0)
+ )
+ )
diff --git a/Build/source/texk/web2c/uptexdir/tests/testnewu.tfm b/Build/source/texk/web2c/uptexdir/tests/testnewu.tfm
new file mode 100644
index 00000000000..6860278f2ca
--- /dev/null
+++ b/Build/source/texk/web2c/uptexdir/tests/testnewu.tfm
Binary files differ
diff --git a/Build/source/texk/web2c/uptexdir/uppltotf.ch b/Build/source/texk/web2c/uptexdir/uppltotf.ch
index 97f833c10b0..2b2fd2c9e2a 100644
--- a/Build/source/texk/web2c/uptexdir/uppltotf.ch
+++ b/Build/source/texk/web2c/uptexdir/uppltotf.ch
@@ -1,9 +1,9 @@
@x
@d my_name=='ppltotf'
-@d banner=='This is pPLtoTF, Version 3.6-p1.8'
+@d banner=='This is pPLtoTF, Version 3.6-p2.0'
@y
@d my_name=='uppltotf'
-@d banner=='This is upPLtoTF, Version 3.6-p1.8-u1.22'
+@d banner=='This is upPLtoTF, Version 3.6-p2.0-u1.22'
@z
@x
@@ -15,7 +15,7 @@
@x
max_kanji=7237; { maximam number of 2byte characters }
@y
-max_kanji=65535; { maximam number of 2byte characters }
+max_kanji=1114111; { maximam number of 2byte characters }
@z
@x function get_next_raw
@@ -24,6 +24,29 @@ if multistrlen(ustringcast(buffer),loc+2,loc)=2 then cur_char:=" "
if multistrlen(ustringcast(buffer),loc+3,loc)>1 then cur_char:=" "
@z
+@x procedure print_jis_hex
+var dig:array[0..3] of byte; {holds jis hex codes}
+i:byte; {index of array}
+begin dig[0]:=Hi(jis_code) div 16; dig[1]:=Hi(jis_code) mod 16;
+dig[2]:=Lo(jis_code) div 16; dig[3]:=Lo(jis_code) mod 16;
+for i:=0 to 3 do
+@y
+var dig:array[0..5] of byte; {holds jis hex codes}
+i:byte; {index of array}
+begin dig[0]:=(jis_code div 65536) div 16; dig[1]:=(jis_code div 65536) mod 16;
+dig[2]:=(jis_code div 4096) mod 16; dig[3]:=(jis_code div 256) mod 16;
+dig[4]:=(jis_code div 16) mod 16; dig[5]:=jis_code mod 16;
+for i:=0 to 1 do
+ if (dig[i]<>0)or(dig[0]<>0) then begin { if dig[0]<>0, dig[1] should be always printed }
+ if dig[i]<10 then print(dig[i]) else
+ case dig[i] of
+ 10: print('A'); 11: print('B'); 12: print('C');
+ 13: print('D'); 14: print('E'); 15: print('F');
+ end;
+ end;
+for i:=2 to 5 do
+@z
+
@x function valid_jis_code
var @!first_byte,@!second_byte:integer; { jis code bytes }
begin valid_jis_code:=true;
@@ -34,7 +57,7 @@ if (first_byte<@"21)
if (second_byte<@"21)or(second_byte>@"7E) then valid_jis_code:=false;
@y
begin valid_jis_code:=true;
-if (cx>@"FFFF)or(not is_char_kanji(fromDVI(cx)))
+if (cx>@"10FFFF)or(not is_char_kanji(fromDVI(cx)))
or(toDVI(fromDVI(cx))<>cx) then valid_jis_code:=false;
@z
@@ -73,6 +96,20 @@ else if (ch='U')or(ch='u') then
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;
if not valid_jis_code(jis_code) then
diff --git a/Build/source/texk/web2c/uptexdir/uptex-m.ch b/Build/source/texk/web2c/uptexdir/uptex-m.ch
index 63305805305..02c6d5dc44e 100644
--- a/Build/source/texk/web2c/uptexdir/uptex-m.ch
+++ b/Build/source/texk/web2c/uptexdir/uptex-m.ch
@@ -148,16 +148,6 @@ if (kcode_pos=1)or((kcode_pos>=@'11)and(kcode_pos<=@'12))
@z
@x
-@d xspace_ptr(#) == info(#+space_offset)
-@y
-@d xspace_ptr(#) == info(#+space_offset)
-@d read_sixteenx(#)==begin #:=fbyte;
- if #>255 then abort;
- fget; #:=#*@'400+fbyte;
- end
-@z
-
-@x
@d kanji=16 {kanji}
@d kana=17 {hiragana, katakana, alphabet}
@d other_kchar=18 {kanji codes}
@@ -731,12 +721,6 @@ if (cur_cmd>=kanji)and(cur_cmd<=hangul) then
@z
@x
- fget; read_sixteen(cx); font_info[k].hh.rh:=tokanji(cx); {|kchar_code|}
-@y
- fget; read_sixteenx(cx); font_info[k].hh.rh:=tokanji(cx); {|kchar_code|}
-@z
-
-@x
@d set2=129 {typeset a character and move right}
@y
@d set2=129 {typeset a character and move right}
diff --git a/Build/source/texk/web2c/uptexdir/uptftopl.ch b/Build/source/texk/web2c/uptexdir/uptftopl.ch
index d18042a40f7..fb3cb224fe9 100644
--- a/Build/source/texk/web2c/uptexdir/uptftopl.ch
+++ b/Build/source/texk/web2c/uptexdir/uptftopl.ch
@@ -1,9 +1,9 @@
@x
@d my_name=='ptftopl'
-@d banner=='This is pTFtoPL, Version 3.3-p1.7'
+@d banner=='This is pTFtoPL, Version 3.3-p2.0'
@y
@d my_name=='uptftopl'
-@d banner=='This is upTFtoPL, Version 3.3-p1.7-u1.22'
+@d banner=='This is upTFtoPL, Version 3.3-p2.0-u1.22'
@z
@x
@@ -15,15 +15,35 @@
@x
@d max_kanji=7237 {number of the kanji characters - 1}
@y
-@d max_kanji=65535 {number of the kanji characters - 1}
+@d max_kanji=1114111 {number of the kanji characters - 1}
@z
@x procedure out_kanji
+i:0..3; {index of array}
+@y
+i:0..5; {index of array}
+@z
+@x
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;
+ for i:=0 to 3 do
@y
begin cx:=jis_code;
if (isinternalUPTEX) then out('U ')
else out('J '); {specify jiscode format}
+ dig[0]:=(cx div 65536) div 16; dig[1]:=(cx div 65536) mod 16;
+ dig[2]:=(cx div 4096) mod 16; dig[3]:=(cx div 256) mod 16;
+ dig[4]:=(cx div 16) mod 16; dig[5]:=cx mod 16;
+ for i:=0 to 1 do
+ if (dig[i]<>0)or(dig[0]<>0) then begin { if dig[0]<>0, dig[1] should be always printed }
+ if dig[i]<10 then out(dig[i]) else
+ case dig[i] of
+ 10: out('A'); 11: out('B'); 12: out('C');
+ 13: out('D'); 14: out('E'); 15: out('F');
+ end;
+ end;
+ for i:=2 to 5 do
@z
@x
@@ -45,7 +65,7 @@ if (first_byte<@"21)
if (second_byte<@"21)or(second_byte>@"7E) then valid_jis_code:=false;
@y
begin valid_jis_code:=true;
-if (cx>@"FFFF)or(not is_char_kanji(fromDVI(cx)))
+if (cx>@"10FFFF)or(not is_char_kanji(fromDVI(cx)))
or(toDVI(fromDVI(cx))<>cx) then valid_jis_code:=false;
@z