diff options
author | Hironobu Yamashita <h.y.acetaminophen@gmail.com> | 2021-06-27 03:02:04 +0000 |
---|---|---|
committer | Hironobu Yamashita <h.y.acetaminophen@gmail.com> | 2021-06-27 03:02:04 +0000 |
commit | d003d3150fb5b3262dd798783dd9b2cb41cc4e64 (patch) | |
tree | a508dda70c8cc29f32413ed0d788aa3717993386 /Build/source | |
parent | 491bfd93917ea07d6ddcd8390b2a39e049cf07bd (diff) |
dvispc.c: avoid encoding conversion for ascii
git-svn-id: svn://tug.org/texlive/trunk@59724 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r-- | Build/source/texk/dviout-util/ChangeLog | 7 | ||||
-rw-r--r-- | Build/source/texk/dviout-util/Makefile.am | 4 | ||||
-rw-r--r-- | Build/source/texk/dviout-util/Makefile.in | 16 | ||||
-rw-r--r-- | Build/source/texk/dviout-util/dvispc.c | 5 | ||||
-rwxr-xr-x | Build/source/texk/dviout-util/dvispc.test | 6 | ||||
-rw-r--r-- | Build/source/texk/dviout-util/tests/put.dump.dvi | bin | 0 -> 260 bytes | |||
-rw-r--r-- | Build/source/texk/dviout-util/tests/put.txt | 35 | ||||
-rw-r--r-- | Build/source/texk/dviout-util/tests/putj.dump.dvi | bin | 0 -> 256 bytes | |||
-rw-r--r-- | Build/source/texk/dviout-util/tests/putj.txt | 35 |
9 files changed, 99 insertions, 9 deletions
diff --git a/Build/source/texk/dviout-util/ChangeLog b/Build/source/texk/dviout-util/ChangeLog index f729be9f19f..55d13d581e2 100644 --- a/Build/source/texk/dviout-util/ChangeLog +++ b/Build/source/texk/dviout-util/ChangeLog @@ -1,3 +1,10 @@ +2021-06-27 Hironobu Yamashita <h.y.acetaminophen@gmail.com> + + * dvispc.c: Avoid encoding conversion in ASCII range + for printing characters with internal-euc/sjis. + * dvispc.test, tests/put[j].dump.dvi, tests/put[j].txt, + Makefile.am: Another test files. + 2021-06-21 Hironobu Yamashita <h.y.acetaminophen@gmail.com> * dvispc.test, chkdvifont.test: Minor adjustments. diff --git a/Build/source/texk/dviout-util/Makefile.am b/Build/source/texk/dviout-util/Makefile.am index 2815a5c30f8..daf51918c50 100644 --- a/Build/source/texk/dviout-util/Makefile.am +++ b/Build/source/texk/dviout-util/Makefile.am @@ -48,7 +48,9 @@ EXTRA_DIST += tests/oldindep.spc \ tests/annot.tex tests/annot.dvi \ tests/longspec.tex tests/longspec.dvi \ tests/flatnest.tex tests/flatnest.dvi \ - tests/jisx0208.dvi tests/jisx0208.txt + tests/jisx0208.dvi tests/jisx0208.txt \ + tests/putj.dump.dvi tests/putj.dump.txt \ + tests/put.dump.dvi tests/put.dump.txt DISTCLEANFILES = x*oldindep.spc \ x*oldindepa.txt x*oldindepax.dvi \ x*oldindep.dry x*oldindepout.dvi \ diff --git a/Build/source/texk/dviout-util/Makefile.in b/Build/source/texk/dviout-util/Makefile.in index 57bfb9055f3..3341dc6e8df 100644 --- a/Build/source/texk/dviout-util/Makefile.in +++ b/Build/source/texk/dviout-util/Makefile.in @@ -573,13 +573,15 @@ EXTRA_DIST = $(TESTS) tests/oldindep.spc tests/oldindep.tex \ tests/firstpn.tex tests/firstpn.dvi tests/firstpn.dry \ tests/annot.tex tests/annot.dvi tests/longspec.tex \ tests/longspec.dvi tests/flatnest.tex tests/flatnest.dvi \ - tests/jisx0208.dvi tests/jisx0208.txt tests/oldindep.cfn \ - tests/jis.tfm tests/jis.cfn tests/eufm10.tfm tests/eufm10.cfn \ - tests/cmr10.pk tests/cmr10.cfn tests/upjisr-h.vf \ - tests/upsjir-h.cfn tests/uparse.tfm tests/uparse.cfn \ - tests/skipjfmp.tfm tests/skipjfmp.cfn \ - tests/upphirakakuw3-h.tfm tests/upphirakakuw3-h.cfn \ - tests/upphirakakuw6-h.tfm tests/upphirakakuw6-h.cfn + tests/jisx0208.dvi tests/jisx0208.txt tests/putj.dump.dvi \ + tests/putj.dump.txt tests/put.dump.dvi tests/put.dump.txt \ + tests/oldindep.cfn tests/jis.tfm tests/jis.cfn \ + tests/eufm10.tfm tests/eufm10.cfn tests/cmr10.pk \ + tests/cmr10.cfn tests/upjisr-h.vf tests/upsjir-h.cfn \ + tests/uparse.tfm tests/uparse.cfn tests/skipjfmp.tfm \ + tests/skipjfmp.cfn tests/upphirakakuw3-h.tfm \ + tests/upphirakakuw3-h.cfn tests/upphirakakuw6-h.tfm \ + tests/upphirakakuw6-h.cfn DISTCLEANFILES = x*oldindep.spc x*oldindepa.txt x*oldindepax.dvi \ x*oldindep.dry x*oldindepout.dvi x*underout.dvi x*tpicpn.dry \ x*tpicpnout.dvi x*tpicsh.dry x*reverse.dry x*reverseout.dvi \ diff --git a/Build/source/texk/dviout-util/dvispc.c b/Build/source/texk/dviout-util/dvispc.c index 431631ec227..e569a2d0b8a 100644 --- a/Build/source/texk/dviout-util/dvispc.c +++ b/Build/source/texk/dviout-util/dvispc.c @@ -314,8 +314,8 @@ const int AdID = (('A'<<24)+('d'<<16)+('O'<<8)+EOP); #ifndef PTEXENC // #define issjis1(c) ((c)>=0x81&&(c)<=0xfc&&((c)<=0x9f||(c)>=0xe0)) // #define issjis2(c) ((c)>=0x40 && (c)<=0xfc && (c)!=0x7f) -#define isjis(c) (((c)>=0x21 && (c)<=0x7e)) #endif +#define isjis(c) (((c)>=0x21 && (c)<=0x7e)) #define is_hex(c) ((c>='0'&&c<='9')||(c>='a'&&c<='f')||(c>='A'&&c<='F')) #define is_oct(c) (c>='0'&&c<='7') // #define is_dig(c) (c>='0'&&c<='9') @@ -1912,6 +1912,8 @@ uint work(FILE *dvi) code = read_n(dvi, mode & 0xf); #ifdef PTEXENC if(f_jstr){ + // internal-euc/sjis: fromDVI cannot convert ASCII range + if (is_internalUPTEX() || (isjis(code>>8) && isjis(code&0xff))) { wch = fromDVI(code); if (is_internalUPTEX()) wch = UCStoUTF8(wch); imb = 0; memset(mbstr, '\0', 4); @@ -1924,6 +1926,7 @@ uint work(FILE *dvi) fputs2(mbstr, fp_out); fprintf(fp_out, "\"\n"); continue; + } } #else if(f_sjis){ diff --git a/Build/source/texk/dviout-util/dvispc.test b/Build/source/texk/dviout-util/dvispc.test index cbfc821f274..ebdfa7ac76d 100755 --- a/Build/source/texk/dviout-util/dvispc.test +++ b/Build/source/texk/dviout-util/dvispc.test @@ -172,6 +172,12 @@ $CMP $testdir/jisx0208.dvi jisx0208.da.dvi || exit 1 ./dvispc -a -Js $testdir/jisx0208.dvi jisx0208-sjp.da.txt || exit 2 ./dvispc -a -Je $testdir/jisx0208.dvi jisx0208-ejp.da.txt || exit 2 +## EXE2TEXT: printing ASCII/Japanese characters +./dvispc -a -Ju $testdir/putj.dump.dvi putj.da.txt || exit 2 +$DIFF $testdir/putj.txt putj.da.txt || exit 1 +./dvispc -a -JU $testdir/put.dump.dvi put.da.txt || exit 2 +$DIFF $testdir/put.txt put.da.txt || exit 1 + exit 0 diff --git a/Build/source/texk/dviout-util/tests/put.dump.dvi b/Build/source/texk/dviout-util/tests/put.dump.dvi Binary files differnew file mode 100644 index 00000000000..63f8a4512ff --- /dev/null +++ b/Build/source/texk/dviout-util/tests/put.dump.dvi diff --git a/Build/source/texk/dviout-util/tests/put.txt b/Build/source/texk/dviout-util/tests/put.txt new file mode 100644 index 00000000000..7542b6a7cb2 --- /dev/null +++ b/Build/source/texk/dviout-util/tests/put.txt @@ -0,0 +1,35 @@ +pre 2 25400000 473628672 1000 0 '' + [1] +bop 1 0 0 0 0 0 0 0 0 0 -1 +fntnum0 +put2 0x30c6 "テ" +right3 655360 +put2 0x30ad "キ" +right3 1310720 +put2 0x30b9 "ス" +right3 1966080 +put2 0x30c8 "ト" +right3 2621440 +set2 0x3067 "で" +set2 0x3042 "あ" +set2 0x308a "り" +right3 1310720 +fntnum1 +put1 0x41 "A" +right3 1638400 +setchar116 +setchar101 +setchar120 +setchar116 + "text" +right3 1310720 +fntnum0 +set2 0x3067 "で" +set2 0x3042 "あ" +set2 0x308b "る" +set2 0x3002 "。" +eop +post 60 25400000 473628672 1000 0 0 0 1 +fntdef1 0 0 1310720 1310720 0 8 'upjisr-h' +fntdef1 1 0 1310720 1310720 0 5 'cmr10' +post_post 176 2 223 223 223 223 diff --git a/Build/source/texk/dviout-util/tests/putj.dump.dvi b/Build/source/texk/dviout-util/tests/putj.dump.dvi Binary files differnew file mode 100644 index 00000000000..41d667aeefa --- /dev/null +++ b/Build/source/texk/dviout-util/tests/putj.dump.dvi diff --git a/Build/source/texk/dviout-util/tests/putj.txt b/Build/source/texk/dviout-util/tests/putj.txt new file mode 100644 index 00000000000..c071eef5b0e --- /dev/null +++ b/Build/source/texk/dviout-util/tests/putj.txt @@ -0,0 +1,35 @@ +pre 2 25400000 473628672 1000 0 '' + [1] +bop 1 0 0 0 0 0 0 0 0 0 -1 +fntnum0 +put2 0x2546 "テ" +right3 655360 +put2 0x252d "キ" +right3 1310720 +put2 0x2539 "ス" +right3 1966080 +put2 0x2548 "ト" +right3 2621440 +set2 0x2447 "で" +set2 0x2422 "あ" +set2 0x246a "り" +right3 1310720 +fntnum1 +put1 0x41 +right3 1638400 +setchar116 +setchar101 +setchar120 +setchar116 + "text" +right3 1310720 +fntnum0 +set2 0x2447 "で" +set2 0x2422 "あ" +set2 0x246b "る" +set2 0x2123 "。" +eop +post 57 25400000 473628672 1000 0 0 0 1 +fntdef1 0 0 1310720 1310720 0 5 'min10' +fntdef1 1 0 1310720 1310720 0 5 'cmr10' +post_post 173 2 223 223 223 223 223 223 |