diff options
author | Hironobu Yamashita <h.y.acetaminophen@gmail.com> | 2018-01-27 02:23:14 +0000 |
---|---|---|
committer | Hironobu Yamashita <h.y.acetaminophen@gmail.com> | 2018-01-27 02:23:14 +0000 |
commit | 5818288af5e420fda055a4d53fb22333a66cd7ad (patch) | |
tree | 7d3eef35c0853a1c06d4dda762ec17e63c24f81a /Build/source/texk/web2c/uptexdir | |
parent | 377d5b6a96e2b1ad97c691da9c9e3f187e51364a (diff) |
ptexdir, uptexdir: introduce a new JFM spec
git-svn-id: svn://tug.org/texlive/trunk@46452 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/uptexdir')
-rw-r--r-- | Build/source/texk/web2c/uptexdir/ChangeLog | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/uptexdir/am/uptex.am | 7 | ||||
-rwxr-xr-x | Build/source/texk/web2c/uptexdir/newjfm.test | 22 | ||||
-rw-r--r-- | Build/source/texk/web2c/uptexdir/tests/testnewu.pl | 130 | ||||
-rw-r--r-- | Build/source/texk/web2c/uptexdir/tests/testnewu.tfm | bin | 0 -> 388 bytes | |||
-rw-r--r-- | Build/source/texk/web2c/uptexdir/uppltotf.ch | 45 | ||||
-rw-r--r-- | Build/source/texk/web2c/uptexdir/uptex-m.ch | 16 | ||||
-rw-r--r-- | Build/source/texk/web2c/uptexdir/uptftopl.ch | 28 |
8 files changed, 226 insertions, 26 deletions
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 Binary files differnew file mode 100644 index 00000000000..6860278f2ca --- /dev/null +++ b/Build/source/texk/web2c/uptexdir/tests/testnewu.tfm 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 |