summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/uptexdir
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/uptexdir
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/uptexdir')
-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
10 files changed, 199 insertions, 24 deletions
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