texlive[59724] Build/source/texk/dviout-util: dvispc.c: avoid
commits+hironobu at tug.org
commits+hironobu at tug.org
Sun Jun 27 05:02:04 CEST 2021
Revision: 59724
http://tug.org/svn/texlive?view=revision&revision=59724
Author: hironobu
Date: 2021-06-27 05:02:04 +0200 (Sun, 27 Jun 2021)
Log Message:
-----------
dvispc.c: avoid encoding conversion for ascii
Modified Paths:
--------------
trunk/Build/source/texk/dviout-util/ChangeLog
trunk/Build/source/texk/dviout-util/Makefile.am
trunk/Build/source/texk/dviout-util/Makefile.in
trunk/Build/source/texk/dviout-util/dvispc.c
trunk/Build/source/texk/dviout-util/dvispc.test
Added Paths:
-----------
trunk/Build/source/texk/dviout-util/tests/put.dump.dvi
trunk/Build/source/texk/dviout-util/tests/put.txt
trunk/Build/source/texk/dviout-util/tests/putj.dump.dvi
trunk/Build/source/texk/dviout-util/tests/putj.txt
Modified: trunk/Build/source/texk/dviout-util/ChangeLog
===================================================================
--- trunk/Build/source/texk/dviout-util/ChangeLog 2021-06-26 23:49:13 UTC (rev 59723)
+++ trunk/Build/source/texk/dviout-util/ChangeLog 2021-06-27 03:02:04 UTC (rev 59724)
@@ -1,3 +1,10 @@
+2021-06-27 Hironobu Yamashita <h.y.acetaminophen at 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 at gmail.com>
* dvispc.test, chkdvifont.test: Minor adjustments.
Modified: trunk/Build/source/texk/dviout-util/Makefile.am
===================================================================
--- trunk/Build/source/texk/dviout-util/Makefile.am 2021-06-26 23:49:13 UTC (rev 59723)
+++ trunk/Build/source/texk/dviout-util/Makefile.am 2021-06-27 03:02:04 UTC (rev 59724)
@@ -48,7 +48,9 @@
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 \
Modified: trunk/Build/source/texk/dviout-util/Makefile.in
===================================================================
--- trunk/Build/source/texk/dviout-util/Makefile.in 2021-06-26 23:49:13 UTC (rev 59723)
+++ trunk/Build/source/texk/dviout-util/Makefile.in 2021-06-27 03:02:04 UTC (rev 59724)
@@ -573,13 +573,15 @@
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 \
Modified: trunk/Build/source/texk/dviout-util/dvispc.c
===================================================================
--- trunk/Build/source/texk/dviout-util/dvispc.c 2021-06-26 23:49:13 UTC (rev 59723)
+++ trunk/Build/source/texk/dviout-util/dvispc.c 2021-06-27 03:02:04 UTC (rev 59724)
@@ -314,8 +314,8 @@
#ifndef PTEXENC
// #define issjis1(c) ((c)>=0x81&&(c)<=0xfc&&((c)<=0x9f||(c)>=0xe0))
// #define issjis2(c) ((c)>=0x40 && (c)<=0xfc && (c)!=0x7f)
+#endif
#define isjis(c) (((c)>=0x21 && (c)<=0x7e))
-#endif
#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 @@
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 @@
fputs2(mbstr, fp_out);
fprintf(fp_out, "\"\n");
continue;
+ }
}
#else
if(f_sjis){
Modified: trunk/Build/source/texk/dviout-util/dvispc.test
===================================================================
--- trunk/Build/source/texk/dviout-util/dvispc.test 2021-06-26 23:49:13 UTC (rev 59723)
+++ trunk/Build/source/texk/dviout-util/dvispc.test 2021-06-27 03:02:04 UTC (rev 59724)
@@ -172,6 +172,12 @@
./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
Added: trunk/Build/source/texk/dviout-util/tests/put.dump.dvi
===================================================================
(Binary files differ)
Index: trunk/Build/source/texk/dviout-util/tests/put.dump.dvi
===================================================================
--- trunk/Build/source/texk/dviout-util/tests/put.dump.dvi 2021-06-26 23:49:13 UTC (rev 59723)
+++ trunk/Build/source/texk/dviout-util/tests/put.dump.dvi 2021-06-27 03:02:04 UTC (rev 59724)
Property changes on: trunk/Build/source/texk/dviout-util/tests/put.dump.dvi
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Build/source/texk/dviout-util/tests/put.txt
===================================================================
--- trunk/Build/source/texk/dviout-util/tests/put.txt (rev 0)
+++ trunk/Build/source/texk/dviout-util/tests/put.txt 2021-06-27 03:02:04 UTC (rev 59724)
@@ -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
Property changes on: trunk/Build/source/texk/dviout-util/tests/put.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Build/source/texk/dviout-util/tests/putj.dump.dvi
===================================================================
(Binary files differ)
Index: trunk/Build/source/texk/dviout-util/tests/putj.dump.dvi
===================================================================
--- trunk/Build/source/texk/dviout-util/tests/putj.dump.dvi 2021-06-26 23:49:13 UTC (rev 59723)
+++ trunk/Build/source/texk/dviout-util/tests/putj.dump.dvi 2021-06-27 03:02:04 UTC (rev 59724)
Property changes on: trunk/Build/source/texk/dviout-util/tests/putj.dump.dvi
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Build/source/texk/dviout-util/tests/putj.txt
===================================================================
--- trunk/Build/source/texk/dviout-util/tests/putj.txt (rev 0)
+++ trunk/Build/source/texk/dviout-util/tests/putj.txt 2021-06-27 03:02:04 UTC (rev 59724)
@@ -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
Property changes on: trunk/Build/source/texk/dviout-util/tests/putj.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
More information about the tex-live-commits
mailing list.