From bfda35382348309e97d9dd46c36b1bb0519d371f Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Sun, 2 May 2010 13:24:00 +0000 Subject: minor fixes for pTeX tools git-svn-id: svn://tug.org/texlive/trunk@18081 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/Makefile.in | 12 ++++++------ Build/source/texk/web2c/help.h | 10 ++++++---- Build/source/texk/web2c/ptexdir/ChangeLog | 7 +++++++ Build/source/texk/web2c/ptexdir/ptftopl.ch | 26 ++++++++++++++------------ Build/source/texk/web2c/ptexdir/yokotate.test | 4 ++-- 5 files changed, 35 insertions(+), 24 deletions(-) (limited to 'Build') diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in index 47df9db681c..bb88e6f2739 100644 --- a/Build/source/texk/web2c/Makefile.in +++ b/Build/source/texk/web2c/Makefile.in @@ -405,9 +405,9 @@ am__libpdftex_a_SOURCES_DIST = pdftexdir/avl.c pdftexdir/avl.h \ pdftexdir/avlstuff.c pdftexdir/avlstuff.h pdftexdir/epdf.c \ pdftexdir/image.h pdftexdir/mapfile.c pdftexdir/pdftex.h \ pdftexdir/pdftex-common.h pdftexdir/pdftoepdf.cc \ - pdftexdir/pdftoepdf.h pdftexdir/pkin.c pdftexdir/ptexlib.h \ - pdftexdir/ptexmac.h pdftexdir/subfont.c pdftexdir/tounicode.c \ - pdftexdir/utils.c pdftexdir/vfpacket.c pdftexdir/writeenc.c \ + pdftexdir/pkin.c pdftexdir/ptexlib.h pdftexdir/ptexmac.h \ + pdftexdir/subfont.c pdftexdir/tounicode.c pdftexdir/utils.c \ + pdftexdir/vfpacket.c pdftexdir/writeenc.c \ pdftexdir/writefont.c pdftexdir/writeimg.c \ pdftexdir/writejbig2.c pdftexdir/writejbig2.h \ pdftexdir/writejpg.c pdftexdir/writepng.c pdftexdir/writet1.c \ @@ -1708,9 +1708,9 @@ libpdftex_a_SOURCES = pdftexdir/avl.c pdftexdir/avl.h \ pdftexdir/avlstuff.c pdftexdir/avlstuff.h pdftexdir/epdf.c \ pdftexdir/image.h pdftexdir/mapfile.c pdftexdir/pdftex.h \ pdftexdir/pdftex-common.h pdftexdir/pdftoepdf.cc \ - pdftexdir/pdftoepdf.h pdftexdir/pkin.c pdftexdir/ptexlib.h \ - pdftexdir/ptexmac.h pdftexdir/subfont.c pdftexdir/tounicode.c \ - pdftexdir/utils.c pdftexdir/vfpacket.c pdftexdir/writeenc.c \ + pdftexdir/pkin.c pdftexdir/ptexlib.h pdftexdir/ptexmac.h \ + pdftexdir/subfont.c pdftexdir/tounicode.c pdftexdir/utils.c \ + pdftexdir/vfpacket.c pdftexdir/writeenc.c \ pdftexdir/writefont.c pdftexdir/writeimg.c \ pdftexdir/writejbig2.c pdftexdir/writejbig2.h \ pdftexdir/writejpg.c pdftexdir/writepng.c pdftexdir/writet1.c \ diff --git a/Build/source/texk/web2c/help.h b/Build/source/texk/web2c/help.h index dcf3d27c6df..d4c0ca5e4e8 100644 --- a/Build/source/texk/web2c/help.h +++ b/Build/source/texk/web2c/help.h @@ -409,10 +409,12 @@ NULL }; const_string PTFTOPLHELP[] = { "Usage: ptftopl [option] tfmfile [plfile]", "", -" -verbose output progress reports.", -" -version print version information and exit.", -" -help print this message and exit.", -" -kanji={jis|euc|sjis|utf8}", +"-charcode-format=TYPE output character codes according to TYPE,", +" either `octal' or `ascii'; default is ascii.", +"-verbose output progress reports.", +"-version print version information and exit.", +"-help print this message and exit.", +"-kanji={jis|euc|sjis|utf8}", " plfile kanji code.", NULL }; #endif /* PTFTOPL */ diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog index e908b8292e7..311c17752f8 100644 --- a/Build/source/texk/web2c/ptexdir/ChangeLog +++ b/Build/source/texk/web2c/ptexdir/ChangeLog @@ -1,3 +1,10 @@ +2010-05-01 Peter Breitenlohner + + * yokotate.test: Use ptftopl with '-charcode-format octal'. + * ptftopl.ch: Correctly check glue indices. + Use Web macros to access |char_type| table entries. + Reformat CHARSINTYPE lists with shorter lines. + 2010-04-30 Peter Breitenlohner * pdvitype.test: Use installed cm fonts. diff --git a/Build/source/texk/web2c/ptexdir/ptftopl.ch b/Build/source/texk/web2c/ptexdir/ptftopl.ch index 3d02e561247..6b384b8602b 100644 --- a/Build/source/texk/web2c/ptexdir/ptftopl.ch +++ b/Build/source/texk/web2c/ptexdir/ptftopl.ch @@ -425,7 +425,7 @@ begin if nonexistent(tfm[k+1]) then @.Glue step for nonexistent...@> else begin left; out('GLUE'); out_char(tfm[k+1]); - if tfm[k+3]>=ng then + if 3*tfm[k+3]>=ng then begin bad('Glue index too large.'); @.Glue index too large@> out(' R 0.0 R 0.0 R 0.0'); @@ -440,19 +440,21 @@ end; @ list the |char_type| table in a similar way to the type table +@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} + @= -this_code:=tfm[4*type_base+0]*@'400+tfm[4*type_base+1]; -this_type:=tfm[4*type_base+2]*@'400+tfm[4*type_base+3]; +this_code:=JIS_code(0); +this_type:=JIS_type(0); if (this_code<>0)or(this_type<>0) then begin bad('the first entry in char_type is not zero. I''ll zero it.'); print_ln('JIS code is ', this_code:1, '. Type is ', this_type:1, '.'); end; for kanji_index:=0 to max_kanji do kanji_type[kanji_index]:=-1; for type_index:=1 to nt-1 do - begin this_code:=tfm[4*type_base + type_index * 4 + 0] * 256 + - tfm[4*type_base + type_index * 4 + 1]; - this_type:=tfm[4*type_base + type_index * 4 + 2] * 256 + - tfm[4*type_base + type_index * 4 + 3]; + begin this_code:=JIS_code(type_index); + this_type:=JIS_type(type_index); if not valid_jis_code(this_code) then bad('jis code ', this_code:1, ' in char_type table entry ', type_index:1, @@ -466,13 +468,13 @@ for type_index:=1 to nt-1 do @# for type_num:=1 to ec do begin left; out('CHARSINTYPE'); - tfm[0]:=type_num; out_octal(0,1); out_ln; + tfm[0]:=type_num; out_octal(0,1); type_count:=0; for kanji_index:=0 to max_kanji do if kanji_type[kanji_index]=type_num then - begin incr(type_count); - if (type_count mod 14)=0 then out_ln; - out_kanji(index_to_jis(kanji_index)); out(' '); + begin if (type_count mod 10)=0 then out_ln else out(' '); + 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!'); out_ln; right; @@ -493,7 +495,7 @@ var @!cx:integer; {KANJI code} i:0..4; {index of array} begin@/ if charcode_format=charcode_octal then - begin cx:=jis_code; out(' J '); {specify jiscode format} + 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 diff --git a/Build/source/texk/web2c/ptexdir/yokotate.test b/Build/source/texk/web2c/ptexdir/yokotate.test index 5c85fb1c683..d6f7465a85a 100755 --- a/Build/source/texk/web2c/ptexdir/yokotate.test +++ b/Build/source/texk/web2c/ptexdir/yokotate.test @@ -15,13 +15,13 @@ for font in min10 tmin10; do cmp $testdir/$font.tfm tests/x$font.tfm || exit 1 TEXMFCNF=$srcdir/../kpathsea \ - ./ptftopl -verbose $testdir/$font.tfm tests/x$font.pl || exit 1 + ./ptftopl -charcode-format octal -verbose $testdir/$font.tfm tests/x$font.pl || exit 1 ./ppltotf tests/x$font tests/xx$font && \ cmp $testdir/$font.tfm tests/xx$font.tfm || exit 1 TEXMFCNF=$srcdir/../kpathsea TFMFONTS=tests \ - ./ptftopl xx$font tests/xx$font && \ + ./ptftopl -charcode-format=octal xx$font tests/xx$font && \ diff tests/x$font.pl tests/xx$font.pl || exit 1 done -- cgit v1.2.3