texlive[64800] Build/source/texk/web2c: pTeX 4.1.0

commits+hironobu at tug.org commits+hironobu at tug.org
Mon Oct 24 12:57:00 CEST 2022


Revision: 64800
          http://tug.org/svn/texlive?view=revision&revision=64800
Author:   hironobu
Date:     2022-10-24 12:57:00 +0200 (Mon, 24 Oct 2022)
Log Message:
-----------
pTeX 4.1.0

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/eptexdir/ChangeLog
    trunk/Build/source/texk/web2c/eptexdir/char-warning-eptex.ch
    trunk/Build/source/texk/web2c/eptexdir/eptex.defines
    trunk/Build/source/texk/web2c/euptexdir/ChangeLog
    trunk/Build/source/texk/web2c/euptexdir/euptex.defines
    trunk/Build/source/texk/web2c/ptexdir/ChangeLog
    trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
    trunk/Build/source/texk/web2c/ptexdir/ptex.defines
    trunk/Build/source/texk/web2c/ptexdir/ptex_version.h
    trunk/Build/source/texk/web2c/uptexdir/ChangeLog
    trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch
    trunk/Build/source/texk/web2c/uptexdir/uptex.defines

Modified: trunk/Build/source/texk/web2c/eptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/ChangeLog	2022-10-23 23:51:34 UTC (rev 64799)
+++ trunk/Build/source/texk/web2c/eptexdir/ChangeLog	2022-10-24 10:57:00 UTC (rev 64800)
@@ -1,3 +1,8 @@
+2022-10-24  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
+
+	* char-warning-eptex.ch: Adapt to pTeX 4.1.0.
+	* eptex.defines: Add toJIS.
+
 2022-10-23  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
 
 	* pdfutils.ch: Import a patch (2021-06-25 @h20y6m) to

Modified: trunk/Build/source/texk/web2c/eptexdir/char-warning-eptex.ch
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/char-warning-eptex.ch	2022-10-23 23:51:34 UTC (rev 64799)
+++ trunk/Build/source/texk/web2c/eptexdir/char-warning-eptex.ch	2022-10-24 10:57:00 UTC (rev 64800)
@@ -61,3 +61,41 @@
  end; {of |tracing_lost_chars>0|}
 end;  {of procedure}
 @z
+
+ at x [30] Another warning for (u)pTeX.
+ at p procedure char_warning_jis(@!f:internal_font_number;@!jc:KANJI_code);
+begin if tracing_lost_chars>0 then
+  begin begin_diagnostic;
+  print_nl("Character "); print_kanji(jc); print(" (");
+  print_hex(jc); print(") cannot be typeset in JIS-encoded JFM ");
+  slow_print(font_name[f]);
+  print_char(","); print_nl("so I use .notdef glyph instead.");
+  end_diagnostic(false);
+  end;
+end;
+ at y
+ at p procedure char_warning_jis(@!f:internal_font_number;@!jc:KANJI_code);
+var old_setting: integer; {saved value of |tracing_online|}
+begin if tracing_lost_chars>0 then
+ begin old_setting:=tracing_online;
+ if eTeX_ex and(tracing_lost_chars>1) then tracing_online:=1;
+ if tracing_lost_chars > 2 then
+  print_err("Character ")
+ else begin
+  begin_diagnostic;
+  print_nl("Character ")
+ end;
+  print_kanji(jc); print(" (");
+  print_hex(jc); print(") cannot be typeset in JIS-encoded JFM ");
+  slow_print(font_name[f]);
+  print_char(",");
+ if tracing_lost_chars > 2 then
+  begin print_nl("  so I use .notdef glyph instead");
+  help0; error; end
+ else
+  begin print_nl("so I use .notdef glyph instead.");
+  end_diagnostic(false); end;
+ tracing_online:=old_setting;
+ end; {of |tracing_lost_chars>0|}
+end;  {of procedure}
+ at z

Modified: trunk/Build/source/texk/web2c/eptexdir/eptex.defines
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/eptex.defines	2022-10-23 23:51:34 UTC (rev 64799)
+++ trunk/Build/source/texk/web2c/eptexdir/eptex.defines	2022-10-24 10:57:00 UTC (rev 64800)
@@ -34,6 +34,7 @@
 @define function fromKUTEN ();
 @define function UCStoUTF8 ();
 @define function fromUCS ();
+ at define function toJIS ();
 @define function toUCS ();
 
 @define function notkanjicharseq ();

Modified: trunk/Build/source/texk/web2c/euptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/euptexdir/ChangeLog	2022-10-23 23:51:34 UTC (rev 64799)
+++ trunk/Build/source/texk/web2c/euptexdir/ChangeLog	2022-10-24 10:57:00 UTC (rev 64800)
@@ -1,3 +1,7 @@
+2022-10-24  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
+
+	* euptex.defines: Add toJIS.
+
 2022-03-21  Karl Berry  <karl at tug.org>
 
 	* TL'22 release.

Modified: trunk/Build/source/texk/web2c/euptexdir/euptex.defines
===================================================================
--- trunk/Build/source/texk/web2c/euptexdir/euptex.defines	2022-10-23 23:51:34 UTC (rev 64799)
+++ trunk/Build/source/texk/web2c/euptexdir/euptex.defines	2022-10-24 10:57:00 UTC (rev 64800)
@@ -38,6 +38,7 @@
 @define function fromKUTEN ();
 @define function fromUCS ();
 @define function UCStoUTF8 ();
+ at define function toJIS ();
 @define function toUCS ();
 
 @define function notkanjicharseq ();

Modified: trunk/Build/source/texk/web2c/ptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2022-10-23 23:51:34 UTC (rev 64799)
+++ trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2022-10-24 10:57:00 UTC (rev 64800)
@@ -1,3 +1,10 @@
+2022-10-24  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
+
+	* ptex-base.ch: Add a new syntax \font [in jis/ucs].
+	New primitives: \tojis, \ptextracingfonts and \ptexfontname.
+	* ptex.defines: Add toJIS.
+	* ptex_version.h: Version p4.1.0.
+
 2022-10-23  Hironori Kitagawa  <h_kitagawa2001 at yahoo.co.jp>
 
 	* ptex-base.ch: initialize k in adjust_hlist.
@@ -31,7 +38,7 @@
 	* pbibtex.ch, ptex.defines:
 	Accept multibyte characters by int.to.chr$ and chr.to.int$, i.e.
 	chr is corresponding to one single character multibyte string.
-	Bump version to j0.35
+	Bump version to j0.35.
 
 2022-05-06  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 

Modified: trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch	2022-10-23 23:51:34 UTC (rev 64799)
+++ trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch	2022-10-24 10:57:00 UTC (rev 64800)
@@ -71,6 +71,8 @@
 %                  for better support of LaTeX3 (expl3).
 %                  Requires ptexenc version 1.4.0.
 %                  More details in TUGboat 41(2):329--334, 2020.
+% (2022-10-24) HY  pTeX p4.1.0 Add new syntax \font [in jis/ucs].
+%                  New primitives: \tojis, \ptextracingfonts and \ptexfontname.
 
 @x
 % Here is TeX material that gets inserted after \input webmac
@@ -84,9 +86,9 @@
 @d banner_k==TeX_banner_k
 @y
 @d pTeX_version=4
- at d pTeX_minor_version=0
+ at d pTeX_minor_version=1
 @d pTeX_revision==".0"
- at d pTeX_version_string=='-p4.0.0' {current \pTeX\ version}
+ at d pTeX_version_string=='-p4.1.0' {current \pTeX\ version}
 @#
 @d pTeX_banner=='This is pTeX, Version 3.141592653',pTeX_version_string
 @d pTeX_banner_k==pTeX_banner
@@ -726,6 +728,13 @@
 of larger type codes will also be defined, for use in math mode only.
 @z
 
+ at x [12.???] pTeX: \ptexfontname, \ptextracingfonts
+ at p procedure short_display(@!p:integer); {prints highlights of list |p|}
+ at y
+ at p@t\4@>@<Declare the pTeX-specific |print_font_...| procedures|@>@;@/
+procedure short_display(@!p:integer); {prints highlights of list |p|}
+ at z
+
 @x [12.174] l.3662 - pTeX: print KANJI
       print_ASCII(qo(character(p)));
 @y
@@ -1436,7 +1445,8 @@
 @d script_baseline_shift_factor_code=58
 @d scriptscript_baseline_shift_factor_code=59
 @d ptex_lineend_code=60
- at d tex_int_pars=61 {total number of \TeX's integer parameters}
+ at d ptex_tracing_fonts_code=61
+ at d tex_int_pars=62 {total number of \TeX's integer parameters}
 @z
 
 @x [17.236] l.5167 - pTeX: cur_jfam, |jchr_widow_penalty|
@@ -1451,6 +1461,7 @@
 @d script_baseline_shift_factor==int_par(script_baseline_shift_factor_code)
 @d scriptscript_baseline_shift_factor==int_par(scriptscript_baseline_shift_factor_code)
 @d ptex_lineend==int_par(ptex_lineend_code)
+ at d ptex_tracing_fonts==int_par(ptex_tracing_fonts_code)
 @z
 
 @x [17.237] l.5244 - pTeX: cur_jfam_code, jchr_window_penalty_code
@@ -1463,6 +1474,7 @@
 script_baseline_shift_factor_code:print_esc("scriptbaselineshiftfactor");
 scriptscript_baseline_shift_factor_code:print_esc("scriptscriptbaselineshiftfactor");
 ptex_lineend_code:print_esc("ptexlineendmode");
+ptex_tracing_fonts_code:print_esc("ptextracingfonts");
 @z
 
 @x [17.238] l.5365 - pTeX: cur_jfam_code, jchr_window_penalty_code
@@ -1483,6 +1495,8 @@
 @!@:scriptscript_baseline_shift_factor}{\.{\\scriptscriptbaselineshiftfactor} primitive@>
 primitive("ptexlineendmode",assign_int,int_base+ptex_lineend_code);@/
 @!@:ptex_lineend_mode_}{\.{\\ptexlineendmode} primitive@>
+primitive("ptextracingfonts",assign_int,int_base+ptex_tracing_fonts_code);@/
+@!@:ptex_tracing_fonts_}{\.{\\ptextracingfonts} primitive@>
 @z
 
 @x [17.247] l.5490 - pTeX: kinsoku, t_baseline_shift, y_baseline_shift
@@ -1628,6 +1642,43 @@
 def_tfont: print_esc("tfont");
 @z
 
+ at x [18.???] pTeX: \ptextracingfonts based on pdfTeX \pdftracingfonts
+@<Print the font identifier for |font(p)|@>=
+print_esc(font_id_text(font(p)))
+ at y
+@<Print the font identifier for |font(p)|@>=
+begin
+  print_esc(font_id_text(font(p)));
+  if ptex_tracing_fonts > 0 then begin
+    print(" (");
+    print_font_name_and_size(font(p));
+  if ptex_tracing_fonts > 1 then begin
+    print_font_dir_and_enc(font(p));
+  end;
+    print(")");
+  end;
+end;
+
+@ @<Declare the pTeX-specific |print_font_...| procedures|@>=
+procedure print_font_name_and_size(f:internal_font_number);
+begin
+  print(font_name[f]);
+  if font_size[f]<>font_dsize[f] then begin
+    print("@@");
+    print_scaled(font_size[f]);
+    print("pt");
+  end;
+end;
+@#
+procedure print_font_dir_and_enc(f:internal_font_number);
+begin
+  if font_dir[f]=dir_tate then print("/TATE")
+  else if font_dir[f]=dir_yoko then print("/YOKO");
+  if font_enc[f]=2 then print("+Unicode")
+  else if font_enc[f]=1 then print("+JIS");
+end;
+ at z
+
 @x [20.289] l.6387 - pTeX: cs_token_flag
 @d cs_token_flag==@'7777 {amount added to the |eqtb| location in a
   token that stands for a control sequence; is a multiple of~256, less~1}
@@ -2637,8 +2688,10 @@
 @d kuten_code=9 {command code for \.{\\kuten}}
 @d ucs_code=10 {command code for \.{\\ucs}}
 @d toucs_code=11 {command code for \.{\\toucs}}
- at d ptex_revision_code=12 {command code for \.{\\ptexrevision}}
- at d ptex_convert_codes=13 {end of \pTeX's command codes}
+ at d tojis_code=12 {command code for \.{\\tojis}}
+ at d ptex_font_name_code=13 {command code for \.{\\ptexfontname}}
+ at d ptex_revision_code=14 {command code for \.{\\ptexrevision}}
+ at d ptex_convert_codes=15 {end of \pTeX's command codes}
 @d job_name_code=ptex_convert_codes {command code for \.{\\jobname}}
 @z
 
@@ -2662,6 +2715,10 @@
 @!@:ucs_}{\.{\\ucs} primitive@>
 primitive("toucs",convert,toucs_code);
 @!@:toucs_}{\.{\\toucs} primitive@>
+primitive("tojis",convert,tojis_code);
+@!@:tojis_}{\.{\\tojis} primitive@>
+primitive("ptexfontname",convert,ptex_font_name_code);
+@!@:ptexfontname_}{\.{\\ptexfontname} primitive@>
 primitive("ptexrevision",convert,ptex_revision_code);
 @!@:ptexrevision_}{\.{\\ptexrevision} primitive@>
 @z
@@ -2677,6 +2734,8 @@
   kuten_code:print_esc("kuten");
   ucs_code:print_esc("ucs");
   toucs_code:print_esc("toucs");
+  tojis_code:print_esc("tojis");
+  ptex_font_name_code: print_esc("ptexfontname");
   ptex_revision_code:print_esc("ptexrevision");
 @z
 
@@ -2701,7 +2760,9 @@
 KANJI(cx):=0;
 case c of
 number_code,roman_numeral_code,
-kansuji_code,euc_code,sjis_code,jis_code,kuten_code,ucs_code,toucs_code: scan_int;
+kansuji_code,euc_code,sjis_code,jis_code,kuten_code,
+ucs_code,toucs_code,tojis_code: scan_int;
+ptex_font_name_code: scan_font_ident;
 ptex_revision_code: do_nothing;
 string_code, meaning_code: begin save_scanner_status:=scanner_status;
   scanner_status:=normal; get_token;
@@ -2723,6 +2784,7 @@
 case c of
 number_code: print_int(cur_val);
 roman_numeral_code: print_roman_int(cur_val);
+kansuji_code: print_kansuji(cur_val);
 jis_code:   begin cur_val:=fromJIS(cur_val);
   if cur_val=0 then print_int(-1) else print_int(cur_val); end;
 euc_code:   begin cur_val:=fromEUC(cur_val);
@@ -2735,8 +2797,13 @@
   if cur_val=0 then print_int(-1) else print_int(cur_val); end;
 toucs_code: begin cur_val:=toUCS(cur_val);
   if cur_val=0 then print_int(-1) else print_int(cur_val); end;
+tojis_code: begin cur_val:=toJIS(cur_val);
+  if cur_val=0 then print_int(-1) else print_int(cur_val); end;
+ptex_font_name_code: begin
+  print_font_name_and_size(cur_val);
+  print_font_dir_and_enc(cur_val);
+  end;
 ptex_revision_code: print(pTeX_revision);
-kansuji_code: print_kansuji(cur_val);
 string_code:if cur_cs<>0 then sprint_cs(cur_cs)
   else if KANJI(cx)=0 then print_char(cur_chr)
   else print_kanji(cx);
@@ -3085,8 +3152,11 @@
 @!font_info: ^memory_word; {pTeX: use halfword for |char_type| table.}
 @!font_dir: ^eight_bits;
   {pTeX: direction of fonts, 0 is default, 1 is Yoko, 2 is Tate}
+@!font_enc: ^eight_bits;
+  {pTeX: encoding of fonts, 0 is default, 1 is JIS, 2 is Unicode}
 @!font_num_ext: ^integer;
   {pTeX: number of the |char_type| table.}
+@!jfm_enc: eight_bits; {pTeX: holds scanned result of encoding}
 @z
 
 @x [30.550] l.11270 - pTeX:
@@ -3099,6 +3169,13 @@
   {pTeX: base addresses for KANJI character type parameters}
 @z
 
+ at x
+@ @<Set init...@>=
+ at y
+@ @<Set init...@>=
+jfm_enc:=0;
+ at z
+
 @x [30.554] l.11373 - pTeX:
 @d orig_char_info_end(#)==#].qqqq
 @d orig_char_info(#)==font_info[char_base[#]+orig_char_info_end
@@ -3238,6 +3315,7 @@
   @<Apologize for not loading the font, |goto done|@>;
 f:=font_ptr+1;
 font_dir[f]:=jfm_flag;
+font_enc[f]:=jfm_enc; if jfm_flag=dir_default then font_enc[f]:=0;
 font_num_ext[f]:=nt;
 ctype_base[f]:=fmem_ptr;
 char_base[f]:=ctype_base[f]+nt-bc;
@@ -3260,8 +3338,15 @@
 if jfm_flag<>dir_default then
   for k:=ctype_base[f] to ctype_base[f]+nt-1 do
     begin
-    fget; read_twentyfourx(cx); font_info[k].hh.rh:=tokanji(cx); {|kchar_code|}
-    fget; cx:=fbyte; font_info[k].hh.lhfield:=tonum(cx); {|kchar_type|}
+    fget; read_twentyfourx(cx);
+    if jfm_enc=2 then {Unicode TFM}
+      font_info[k].hh.rh:=toDVI(fromUCS(cx))
+    else if jfm_enc=1 then {JIS-encoded TFM}
+      font_info[k].hh.rh:=toDVI(fromJIS(cx))
+    else
+      font_info[k].hh.rh:=tokanji(cx); {|kchar_code|}
+    fget; cx:=fbyte;
+    font_info[k].hh.lhfield:=tonum(cx); {|kchar_type|}
     end;
 for k:=char_base[f]+bc to width_base[f]-1 do
   begin store_four_quarters(font_info[k].qqqq);
@@ -3347,6 +3432,25 @@
   print(" in font ");
 @z
 
+ at x [30.???]
+@ Here is a function that returns a pointer to a character node for a
+ at y
+@ Another warning for (u)\pTeX.
+
+ at p procedure char_warning_jis(@!f:internal_font_number;@!jc:KANJI_code);
+begin if tracing_lost_chars>0 then
+  begin begin_diagnostic;
+  print_nl("Character "); print_kanji(jc); print(" (");
+  print_hex(jc); print(") cannot be typeset in JIS-encoded JFM ");
+  slow_print(font_name[f]);
+  print_char(","); print_nl("so I use .notdef glyph instead.");
+  end_diagnostic(false);
+  end;
+end;
+
+@ Here is a function that returns a pointer to a character node for a
+ at z
+
 @x [31.586] l.12189 - pTeX: define set2
 @d set1=128 {typeset a character and move right}
 @y
@@ -3492,7 +3596,14 @@
       synch_h;
       end;
     p:=link(p);
-    jc:=toDVI(KANJI(info(p)));
+    jc:=KANJI(info(p));
+    if font_enc[f]=2 then {Unicode TFM}
+      jc:=toUCS(jc)
+    else if font_enc[f]=1 then {JIS-encoded TFM}
+      begin if toJIS(jc)=0 then char_warning_jis(f,jc);
+      jc:=toJIS(jc); end
+    else
+      jc:=toDVI(jc);
     dvi_out(set2); dvi_out(Hi(jc)); dvi_out(Lo(jc));
     cur_h:=cur_h+char_width(f)(orig_char_info(f)(c)); {not |jc|}
     end;
@@ -6369,10 +6480,13 @@
 @z
 
 @x [49.1211] l.23397 - pTeX: prefixed_command
+ at t\4@>@<Declare subprocedures for |prefixed_command|@>@t@>@;@/
 procedure prefixed_command;
 label done,exit;
 var a:small_number; {accumulated prefix codes so far}
 @y
+ at t\4@>@<Declare the function called |scan_keyword_noexpand|@>
+@<Declare subprocedures for |prefixed_command|@>@t@>@;@/
 procedure prefixed_command;
 label done,exit;
 var a:small_number; {accumulated prefix codes so far}
@@ -6548,6 +6662,13 @@
 def_tfont,def_jfont,def_font: new_font(a);
 @z
 
+ at x [49.????] pTeX: new_font
+get_r_token; u:=cur_cs;
+ at y
+@<Scan the font encoding specification@>;
+get_r_token; u:=cur_cs;
+ at z
+
 @x [49.1292] l.24451 - pTeX: shift_case
 @<Change the case of the token in |p|, if a change is appropriate@>=
 t:=info(p);
@@ -6663,6 +6784,7 @@
 @ @<Dump the array info for internal font number |k|@>=
 begin
 dump_things(font_dir[null_font], font_ptr+1-null_font);
+dump_things(font_enc[null_font], font_ptr+1-null_font);
 dump_things(font_num_ext[null_font], font_ptr+1-null_font);
 dump_things(font_check[null_font], font_ptr+1-null_font);
 @z
@@ -6681,6 +6803,7 @@
 @<Undump the array info for internal font number |k|@>=
 begin {Allocate the font arrays}
 font_dir:=xmalloc_array(eight_bits, font_max);
+font_enc:=xmalloc_array(eight_bits, font_max);
 font_num_ext:=xmalloc_array(integer, font_max);
 @z
 
@@ -6695,6 +6818,7 @@
 undump_things(font_check[null_font], font_ptr+1-null_font);
 @y
 undump_things(font_dir[null_font], font_ptr+1-null_font);
+undump_things(font_enc[null_font], font_ptr+1-null_font);
 undump_things(font_num_ext[null_font], font_ptr+1-null_font);
 undump_things(font_check[null_font], font_ptr+1-null_font);
 @z
@@ -6723,6 +6847,7 @@
   font_check:=xmalloc_array(four_quarters, font_max);
 @y
   font_dir:=xmalloc_array(eight_bits, font_max);
+  font_enc:=xmalloc_array(eight_bits, font_max);
   font_num_ext:=xmalloc_array(integer, font_max);
   font_check:=xmalloc_array(four_quarters, font_max);
 @z
@@ -6739,6 +6864,7 @@
 @y
   font_ptr:=null_font; fmem_ptr:=7;
   font_dir[null_font]:=dir_default;
+  font_enc[null_font]:=0;
   font_num_ext[null_font]:=0;
 @z
 
@@ -6890,7 +7016,9 @@
 jc:=toDVI(kcode);
 sp:=1; { start position }
 ep:=font_num_ext[f]-1; { end position }
-if (ep>=1)and(kchar_code(f)(sp)<=jc)and(jc<=kchar_code(f)(ep)) then
+if (ep>=1) then { nt is larger than 1; |char_type| is non-empty }
+if font_enc[f]=0 then { |kchar_code| are ordered; faster search }
+begin if (kchar_code(f)(sp)<=jc)and(jc<=kchar_code(f)(ep)) then
   begin while (sp <= ep) do
     begin mp:=sp+((ep-sp) div 2);
     if jc<kchar_code(f)(mp) then ep:=mp-1
@@ -6900,9 +7028,56 @@
       end;
     end;
   end;
+end
+else { TFM-DVI encoding conversion; whole search }
+  begin while (sp <= ep) do
+    if jc=kchar_code(f)(sp) then
+      begin get_jfm_pos:=kchar_type(f)(sp); return;
+      end
+    else incr(sp);
+  end;
 get_jfm_pos:=kchar_type(f)(0);
 end;
 
+@ The function |scan_keyword_noexpand| is used to scan a keyword
+preceding possibly undefined control sequence.
+It is used while scanning \.{\\font} with JFM encoding specification.
+
+@<Declare the function called |scan_keyword_noexpand|@>=
+function scan_keyword_noexpand(@!s:str_number):boolean;
+label exit;
+var p:pointer; {tail of the backup list}
+@!q:pointer; {new node being added to the token list via |store_new_token|}
+@!k:pool_pointer; {index into |str_pool|}
+begin p:=backup_head; link(p):=null; k:=str_start[s];
+while k<str_start[s+1] do
+  begin get_token; {no expansion}
+  if (cur_cs=0)and@|
+   ((cur_chr=so(str_pool[k]))or(cur_chr=so(str_pool[k])-"a"+"A")) then
+    begin store_new_token(cur_tok); incr(k);
+    end
+  else if (cur_cmd<>spacer)or(p<>backup_head) then
+    begin back_input;
+    if p<>backup_head then back_list(link(backup_head));
+    scan_keyword_noexpand:=false; return;
+    end;
+  end;
+flush_list(link(backup_head)); scan_keyword_noexpand:=true;
+exit:end;
+
+@ @<Scan the font encoding specification@>=
+begin jfm_enc:=0;
+if scan_keyword_noexpand("in") then
+  if scan_keyword_noexpand("jis") then jfm_enc:=1
+  else if scan_keyword_noexpand("ucs") then jfm_enc:=2
+  else begin
+    print_err("Unknown TFM encoding");
+ at .Unknown TFM encoding@>
+    help1("TFM encoding specification is ignored.");@/
+    error;
+  end;
+end
+
 @ Following codes are used to calculate a KANJI width and height.
 
 @<Local variables for dimension calculations@>=

Modified: trunk/Build/source/texk/web2c/ptexdir/ptex.defines
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ptex.defines	2022-10-23 23:51:34 UTC (rev 64799)
+++ trunk/Build/source/texk/web2c/ptexdir/ptex.defines	2022-10-24 10:57:00 UTC (rev 64800)
@@ -27,6 +27,7 @@
 @define function fromSJIS ();
 @define function fromKUTEN ();
 @define function fromUCS ();
+ at define function toJIS ();
 @define function toUCS ();
 
 @define function notkanjicharseq ();

Modified: trunk/Build/source/texk/web2c/ptexdir/ptex_version.h
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ptex_version.h	2022-10-23 23:51:34 UTC (rev 64799)
+++ trunk/Build/source/texk/web2c/ptexdir/ptex_version.h	2022-10-24 10:57:00 UTC (rev 64800)
@@ -1 +1 @@
-#define PTEX_VERSION "p4.0.0"
+#define PTEX_VERSION "p4.1.0"

Modified: trunk/Build/source/texk/web2c/uptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/ChangeLog	2022-10-23 23:51:34 UTC (rev 64799)
+++ trunk/Build/source/texk/web2c/uptexdir/ChangeLog	2022-10-24 10:57:00 UTC (rev 64800)
@@ -1,3 +1,8 @@
+2022-10-24  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
+
+	* uptex-m.ch: Add to pTeX 4.1.0.
+	* uptex.defines: Add toJIS.
+
 2022-09-03  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 
 	* upbibtex.ch:

Modified: trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch	2022-10-23 23:51:34 UTC (rev 64799)
+++ trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch	2022-10-24 10:57:00 UTC (rev 64800)
@@ -662,12 +662,12 @@
 
 @x
 
- at d ptex_revision_code=12 {command code for \.{\\ptexrevision}}
- at d ptex_convert_codes=13 {end of \pTeX's command codes}
+ at d ptex_revision_code=14 {command code for \.{\\ptexrevision}}
+ at d ptex_convert_codes=15 {end of \pTeX's command codes}
 @y
- at d ptex_revision_code=12 {command code for \.{\\ptexrevision}}
- at d uptex_revision_code=13 {command code for \.{\\uptexrevision}}
- at d ptex_convert_codes=14 {end of \pTeX's command codes}
+ at d ptex_revision_code=14 {command code for \.{\\ptexrevision}}
+ at d uptex_revision_code=15 {command code for \.{\\uptexrevision}}
+ at d ptex_convert_codes=16 {end of \pTeX's command codes}
 @z
 
 @x
@@ -757,10 +757,14 @@
 @z
 
 @x
-    jc:=toDVI(KANJI(info(p)));
+    jc:=KANJI(info(p));
+ at y
+    jc:=KANJI(info(p)) mod max_cjk_val;
+ at z
+
+ at x
     dvi_out(set2); dvi_out(Hi(jc)); dvi_out(Lo(jc));
 @y
-    jc:=toDVI(KANJI(info(p)) mod max_cjk_val);
     if (jc<@"10000) then begin
       dvi_out(set2);
     end else begin

Modified: trunk/Build/source/texk/web2c/uptexdir/uptex.defines
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/uptex.defines	2022-10-23 23:51:34 UTC (rev 64799)
+++ trunk/Build/source/texk/web2c/uptexdir/uptex.defines	2022-10-24 10:57:00 UTC (rev 64800)
@@ -36,6 +36,7 @@
 @define function fromSJIS ();
 @define function fromKUTEN ();
 @define function fromUCS ();
+ at define function toJIS ();
 @define function toUCS ();
 
 @define function notkanjicharseq ();



More information about the tex-live-commits mailing list.