texlive[62017] Build/source/texk/web2c/eptexdir: e[u]ptex: add

commits+hironobu at tug.org commits+hironobu at tug.org
Mon Feb 14 13:33:25 CET 2022


Revision: 62017
          http://tug.org/svn/texlive?view=revision&revision=62017
Author:   hironobu
Date:     2022-02-14 13:33:25 +0100 (Mon, 14 Feb 2022)
Log Message:
-----------
e[u]ptex: add \lastnodefont, version 220214

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/eptexdir/ChangeLog
    trunk/Build/source/texk/web2c/eptexdir/eptex.ech
    trunk/Build/source/texk/web2c/eptexdir/eptex_version.h

Added Paths:
-----------
    trunk/Build/source/texk/web2c/eptexdir/tests/lastnodefont.tex

Modified: trunk/Build/source/texk/web2c/eptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/ChangeLog	2022-02-14 06:44:19 UTC (rev 62016)
+++ trunk/Build/source/texk/web2c/eptexdir/ChangeLog	2022-02-14 12:33:25 UTC (rev 62017)
@@ -1,7 +1,15 @@
+2022-02-14  Hironori Kitagawa  <h_kitagawa2001 at yahoo.co.jp>
+
+	* eptex.ech, eptex_version.h: e-pTeX version 220214.
+
 2022-02-05  Hironori Kitagawa  <h_kitagawa2001 at yahoo.co.jp>
 
 	* eptex.defines: Add isinternalUPTEX and isterminalUTF8.
 
+2022-01-29  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
+
+	* eptex.ech: Add \lastnodefont.
+
 2022-01-26  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
 
 	* eptex.ech: Adapt \showmode to follow \showstream.

Modified: trunk/Build/source/texk/web2c/eptexdir/eptex.ech
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/eptex.ech	2022-02-14 06:44:19 UTC (rev 62016)
+++ trunk/Build/source/texk/web2c/eptexdir/eptex.ech	2022-02-14 12:33:25 UTC (rev 62017)
@@ -32,8 +32,8 @@
 @y
 @d eTeX_version_string=='-2.6' {current \eTeX\ version}
 @#
- at d epTeX_version_string=='-211207'
- at d epTeX_version_number==211207
+ at d epTeX_version_string=='-220214'
+ at d epTeX_version_number==220214
 @z
 
 @x e-pTeX: banner
@@ -92,6 +92,13 @@
 @d read_papersize_special==int_par(read_papersize_special_code)
 @z
 
+ at x [26.???] prepare for |scan_font_ident| to recognize \lastnodefont
+ at p procedure@?scan_int; forward; {scans an integer value}
+ at y
+ at p procedure@?scan_int; forward; {scans an integer value}
+procedure@?scan_something_internal_ident; forward;
+ at z
+
 @x [26.413] l.8343 - e-pTeX: scan_something_internal
 var m:halfword; {|chr_code| part of the operand token}
 @y
@@ -99,14 +106,26 @@
 var m:halfword; {|chr_code| part of the operand token}
 @z
 
+ at x [26.???] add |scan_something_internal_ident| (used in |scan_font_ident|)
+@<Fix the reference count, if any, and negate |cur_val| if |negative|@>;
+end;
+ at y
+@<Fix the reference count, if any, and negate |cur_val| if |negative|@>;
+end;
+
+@ @p procedure scan_something_internal_ident;
+  begin scan_something_internal(ident_val,false); end;
+ at z
+
 @x
 @d input_line_no_code=glue_val+2 {code for \.{\\inputlineno}}
 @d badness_code=glue_val+2 {code for \.{\\badness}}
 @y
- at d last_node_char_code=glue_val+2 {code for \.{\\lastnodechar}}
- at d last_node_subtype_code=glue_val+3 {code for \.{\\lastnodesubtype}}
- at d input_line_no_code=glue_val+4 {code for \.{\\inputlineno}}
- at d badness_code=glue_val+5 {code for \.{\\badness}}
+ at d last_node_subtype_code=glue_val+2 {code for \.{\\lastnodesubtype}}
+ at d last_node_char_code=glue_val+3 {code for \.{\\lastnodechar}}
+ at d last_node_font_code=glue_val+4 {code for \.{\\lastnodefont}}
+ at d input_line_no_code=glue_val+5 {code for \.{\\inputlineno}}
+ at d badness_code=glue_val+6 {code for \.{\\badness}}
 @z
 
 @x
@@ -192,14 +211,6 @@
     end;
   if ((type(r)=penalty_node) and (subtype(r)=kinsoku_pena)) then tx:=last_jchr else tx:=r;
   end;
-if not is_char_node(tx) then
-  begin if type(tx)=ligature_node then
-    begin r:=lig_ptr(tx);
-    while link(r)<>null do r:=link(r);
-    cur_val:=qo(character(r));
-    end
-  end
-else find_last_char;
 end
 @z
 
@@ -224,14 +235,19 @@
   else if cur_chr=last_node_char_code then
     begin cur_val_level:=int_val; cur_val:=-1;
     end
+  else if cur_chr=last_node_font_code then
+    begin cur_val_level:=ident_val; cur_val:=null_font+font_id_base;
+    end
   else cur_val_level:=cur_chr;
-  if (cur_chr=last_node_char_code)and(is_char_node(tx))and(tx<>head) then
-  { |tx| might be ``second node'' of a KANJI character; so we need to look the node before |tx| }
-  begin r:=head; q:=head;
-    while q<>tx do begin r:=q; q:=link(q); end; { |r| is the node just before |tx| }
-    if (r<>head)and is_char_node(r) then if font_dir[font(r)]<>dir_default then tx:=r;
-    find_last_char;
-    end;
+  if (cur_chr=last_node_char_code)or(cur_chr=last_node_font_code) then
+    if is_char_node(tx)and(tx<>head) then begin
+      { |tx| might be ``second node'' of a KANJI character; so we need to look the node before |tx| }
+      r:=head; q:=head;
+      while q<>tx do begin r:=q; q:=link(q); end; { |r| is the node just before |tx| }
+      if (r<>head)and is_char_node(r) then if font_dir[font(r)]<>dir_default then tx:=r;
+      if cur_chr=last_node_char_code then find_last_char
+      else cur_val:=font(tx)+font_id_base;
+      end;
 @z
 
 @x [26.424] e-pTeX: node types
@@ -249,12 +265,31 @@
         { non-math nodes }
       else begin
         cur_val:=type(tx);
-	if cur_val<unset_node+4 then cur_val:=cur_val-unset_node-1
-	  { |style_noad|, |choice_noad|, |ord_noad| }
+        if cur_val<unset_node+4 then cur_val:=cur_val-unset_node-1
+          { |style_noad|, |choice_noad|, |ord_noad| }
         else if cur_val=unset_node+4 then cur_val:=cur_val-unset_node-1+subtype(tx)
-	else cur_val:=cur_val-unset_node+1;
+        else cur_val:=cur_val-unset_node+1;
       end;
-    last_node_char_code: ignore_font_kerning;
+    last_node_char_code: begin
+      ignore_font_kerning;
+      if is_char_node(tx) then
+        find_last_char
+      else if type(tx)=ligature_node then
+        {decompose a ligature to original characters}
+        begin r:=lig_ptr(tx);
+        while link(r)<>null do r:=link(r);
+        cur_val:=qo(character(r));
+        end
+      {else: already -1}
+      end;
+    last_node_font_code: begin
+      ignore_font_kerning;
+      if is_char_node(tx) then
+        cur_val:=font(tx)+font_id_base
+      else if type(tx)=ligature_node then
+        cur_val:=font(lig_char(tx))+font_id_base
+      {else: already nullfont}
+      end;
 @z
 
 @x
@@ -270,6 +305,15 @@
 @d if_tdir_code=if_case_code+4 { `\.{\\iftdir}' }
 @z
 
+ at x [30.???] |scan_font_ident|: recognize \lastnodefont
+else  begin print_err("Missing font identifier");
+ at y
+else if (cur_cmd=last_item)and(cur_chr=last_node_font_code) then
+  begin scan_something_internal_ident; f:=cur_val-font_id_base;
+  end
+else  begin print_err("Missing font identifier");
+ at z
+
 @x
 @d box_lr(#) == (qo(subtype(#))) {direction mode of a box}
 @d set_box_lr(#) ==  subtype(#):=set_box_lr_end
@@ -499,10 +543,12 @@
 @y
 primitive("lastnodetype",last_item,last_node_type_code);
 @!@:last_node_type_}{\.{\\lastnodetype} primitive@>
+primitive("lastnodesubtype",last_item,last_node_subtype_code);
+@!@:last_node_subtype_}{\.{\\lastnodesubtype} primitive@>
 primitive("lastnodechar",last_item,last_node_char_code);
 @!@:last_node_char_}{\.{\\lastnodechar} primitive@>
-primitive("lastnodesubtype",last_item,last_node_subtype_code);
-@!@:last_node_subtype_}{\.{\\lastnodesubtype} primitive@>
+primitive("lastnodefont",last_item,last_node_font_code);
+@!@:last_node_font_}{\.{\\lastnodefont} primitive@>
 @z
 
 @x
@@ -509,8 +555,9 @@
 last_node_type_code: print_esc("lastnodetype");
 @y
 last_node_type_code: print_esc("lastnodetype");
+last_node_subtype_code: print_esc("lastnodesubtype");
 last_node_char_code: print_esc("lastnodechar");
-last_node_subtype_code: print_esc("lastnodesubtype");
+last_node_font_code: print_esc("lastnodefont");
 @z
 
 @x

Modified: trunk/Build/source/texk/web2c/eptexdir/eptex_version.h
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/eptex_version.h	2022-02-14 06:44:19 UTC (rev 62016)
+++ trunk/Build/source/texk/web2c/eptexdir/eptex_version.h	2022-02-14 12:33:25 UTC (rev 62017)
@@ -1 +1 @@
-#define EPTEX_VERSION "211207"
+#define EPTEX_VERSION "220214"

Added: trunk/Build/source/texk/web2c/eptexdir/tests/lastnodefont.tex
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/tests/lastnodefont.tex	                        (rev 0)
+++ trunk/Build/source/texk/web2c/eptexdir/tests/lastnodefont.tex	2022-02-14 12:33:25 UTC (rev 62017)
@@ -0,0 +1,24 @@
+\newcount\res
+\def\test#1{%
+  \setbox0\hbox{#1\global\res=\lastnodechar\global\xdef\rf{\the\lastnodefont}}%
+  \leavevmode\hbox to 5em{\hss \the\res}, \hbox to 10em{\tentt\meaning\rf\hss}%
+  \copy0\par}
+
+\global\res=\lastnodechar\xdef\rf{\the\lastnodefont}\the\res. {\tentt \meaning\rf}
+
+\ybaselineshift-10pt
+\setbox0\vbox{\vskip10pt\global\res=\lastnodechar\global\xdef\rf{\the\lastnodefont}}%
+\leavevmode\hbox to 5em{\hss \the\res}, \hbox to 10em{\tentt\meaning\rf\hss}%
+
+\test{}
+\test{a}
+\test{ffi}
+\test{漢)}
+\test{漢字}
+\hbox{\tate \test{漢字}}
+\test{あ\kern-1pt}
+\test{あ\hskip10pt}
+\test{あ\/}
+
+
+\bye


Property changes on: trunk/Build/source/texk/web2c/eptexdir/tests/lastnodefont.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property


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