texlive[51624] Build/source/texk/web2c/eptexdir: eptex: version

commits+hironobu at tug.org commits+hironobu at tug.org
Fri Jul 12 18:08:21 CEST 2019


Revision: 51624
          http://tug.org/svn/texlive?view=revision&revision=51624
Author:   hironobu
Date:     2019-07-12 18:08:21 +0200 (Fri, 12 Jul 2019)
Log Message:
-----------
eptex: version 190709 (add \ifincsname, revise \iffontchar and \fontchar??

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
    trunk/Build/source/texk/web2c/eptexdir/pdfutils.ch

Added Paths:
-----------
    trunk/Build/source/texk/web2c/eptexdir/tests/fontchar.sh
    trunk/Build/source/texk/web2c/eptexdir/tests/fontchar.tex
    trunk/Build/source/texk/web2c/eptexdir/tests/zero_search.tex

Modified: trunk/Build/source/texk/web2c/eptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/ChangeLog	2019-07-12 16:07:27 UTC (rev 51623)
+++ trunk/Build/source/texk/web2c/eptexdir/ChangeLog	2019-07-12 16:08:21 UTC (rev 51624)
@@ -1,3 +1,17 @@
+2019-07-09  Hironori Kitagawa  <h_kitagawa2001 at yahoo.co.jp>
+
+	* pdfutils.ch: Add primitive \ifincsname.
+	* eptex.ech: Revise \iffontchar and \fontchar?? to treat
+	negative value as char_type.
+	  - \iffontchar (Japanese font f) (number c):
+	    - c >= 0: true iff is_char_kanji(c)
+	    - c < 0: true iff f has char_type -(c+1)
+	  - \fontcharwd (Japanese font f) (number c):
+	    - c >= 0: return the width of character c
+	    - c < 0: return the width of char_type -(c+1)
+	* tests/fontchar.{sh,tex}, tests/zero_search.tex: Added.
+	* eptex.ech, eptex_version.h: e-pTeX version 190709.
+
 2019-05-28  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
 
 	* am/eptex.am: Add a new test.

Modified: trunk/Build/source/texk/web2c/eptexdir/eptex.ech
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/eptex.ech	2019-07-12 16:07:27 UTC (rev 51623)
+++ trunk/Build/source/texk/web2c/eptexdir/eptex.ech	2019-07-12 16:08:21 UTC (rev 51624)
@@ -26,8 +26,8 @@
 @y
 @d eTeX_version_string=='-2.6' {current \eTeX\ version}
 @#
- at d epTeX_version_string=='-190131'
- at d epTeX_version_number==190131
+ at d epTeX_version_string=='-190709'
+ at d epTeX_version_number==190709
 @z
 
 @x e-pTeX: banner
@@ -173,14 +173,14 @@
   tx:=last_jchr
 else if (type(tx)=kern_node) and (subtype(tx)=normal) then
   begin r:=head; q:=link(head);
-  while q<>tx do 
-    begin r:=q; 
+  while q<>tx do
+    begin r:=q;
     if is_char_node(q) then if font_dir[font(q)]<>dir_default then q:=link(q);
     q:=link(q);
     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 
+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);
@@ -213,12 +213,12 @@
     begin cur_val_level:=int_val; cur_val:=-1;
     end
   else cur_val_level:=cur_chr;
-  if (cur_chr=last_node_char_code)and(is_char_node(tx))and(tx<>head) then 
+  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; 
+    find_last_char;
     end;
 @z
 
@@ -514,7 +514,9 @@
 saving_hyph_codes_code:print_esc("savinghyphcodes");
 read_papersize_special_code:print_esc("readpapersizespecial");
 @z
+
 @x e-pTeX: font_char_{wd,ht,dp,ic}_code l.27306
+font_char_ic_code: begin scan_font_ident; q:=cur_val; scan_char_num;
   if (font_bc[q]<=cur_val)and(font_ec[q]>=cur_val) then
     begin i:=char_info(q)(qi(cur_val));
     case m of
@@ -527,9 +529,20 @@
   else cur_val:=0;
   end;
 @y
+font_char_ic_code: begin scan_font_ident; q:=cur_val;
   if font_dir[q]<>dir_default then {Japanese font}
-    begin if is_char_kanji(cur_val) then {Japanese Character}
-      begin cur_val:=get_jfm_pos(KANJI(cur_val),q);
+    begin scan_int;
+    if cur_val>=0 then
+      begin if is_char_kanji(cur_val) then {Japanese Character}
+        cur_val:=get_jfm_pos(KANJI(cur_val),q)
+      else cur_val:=-1
+      end
+    else begin
+      cur_val:=-(cur_val+1);
+      if (font_bc[q]>cur_val)or(font_ec[q]<cur_val) then cur_val:=-1
+    end;
+    if cur_val<>-1 then
+      begin
       i:=orig_char_info(q)(qi(cur_val));
       case m of
       font_char_wd_code: cur_val:=char_width(q)(i);
@@ -540,16 +553,18 @@
       end
     else cur_val:=0;
     end
-  else if (font_bc[q]<=cur_val)and(font_ec[q]>=cur_val) then
-    begin i:=orig_char_info(q)(qi(cur_val));
-    case m of
-    font_char_wd_code: cur_val:=char_width(q)(i);
-    font_char_ht_code: cur_val:=char_height(q)(height_depth(i));
-    font_char_dp_code: cur_val:=char_depth(q)(height_depth(i));
-    font_char_ic_code: cur_val:=char_italic(q)(i);
-    end; {there are no other cases}
+  else begin scan_char_num;
+    if (font_bc[q]<=cur_val)and(font_ec[q]>=cur_val) then
+      begin i:=orig_char_info(q)(qi(cur_val));
+      case m of
+      font_char_wd_code: cur_val:=char_width(q)(i);
+      font_char_ht_code: cur_val:=char_height(q)(height_depth(i));
+      font_char_dp_code: cur_val:=char_depth(q)(height_depth(i));
+      font_char_ic_code: cur_val:=char_italic(q)(i);
+      end; {there are no other cases}
+      end
+    else cur_val:=0;
     end
-  else cur_val:=0;
   end;
 @z
 
@@ -624,9 +639,28 @@
 @z
 
 @x e-pTeX: if_font_char_code l.28633
+if_font_char_code:begin scan_font_ident; n:=cur_val; scan_char_num;
+  if (font_bc[n]<=cur_val)and(font_ec[n]>=cur_val) then
     b:=char_exists(char_info(n)(qi(cur_val)))
+  else b:=false;
+  end;
 @y
-    b:=char_exists(orig_char_info(n)(qi(cur_val)))
+if_font_char_code:begin scan_font_ident; n:=cur_val;
+  if font_dir[n]<>dir_default then
+    begin scan_int;
+    if cur_val>=0 then b:=is_char_kanji(cur_val)
+    { In u\pTeX, $\hbox{|is_char_kanji|} = \lambda x\mathpunct{.} x\ge 0$ }
+    else begin
+      cur_val:=-(cur_val+1);
+      b:=(font_bc[n]<=cur_val)and(font_ec[n]>=cur_val)
+      end
+    end
+  else begin scan_char_num;
+    if (font_bc[n]<=cur_val)and(font_ec[n]>=cur_val) then @/
+      b:=char_exists(orig_char_info(n)(qi(cur_val)))
+    else b:=false;
+    end;
+  end;
 @z
 
 @x

Modified: trunk/Build/source/texk/web2c/eptexdir/eptex_version.h
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/eptex_version.h	2019-07-12 16:07:27 UTC (rev 51623)
+++ trunk/Build/source/texk/web2c/eptexdir/eptex_version.h	2019-07-12 16:08:21 UTC (rev 51624)
@@ -1 +1 @@
-#define EPTEX_VERSION "190131"
+#define EPTEX_VERSION "190709"

Modified: trunk/Build/source/texk/web2c/eptexdir/pdfutils.ch
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/pdfutils.ch	2019-07-12 16:07:27 UTC (rev 51623)
+++ trunk/Build/source/texk/web2c/eptexdir/pdfutils.ch	2019-07-12 16:08:21 UTC (rev 51624)
@@ -24,6 +24,9 @@
 %%
 %% \pdfelapsedtime and \pdfresettimer
 %%
+%% \expanded
+%%
+%% \ifincsname
 
 @x
 @* \[8] Packed data.
@@ -620,7 +623,28 @@
    else print_esc("pdfprimitive");
 @z
 
+ at x \ifincsname
+var t:halfword; {token that is being ``expanded after''}
+@!p,@!q,@!r:pointer; {for list manipulation}
+ at y
+var t:halfword; {token that is being ``expanded after''}
+@!b:boolean; {keep track of nested csnames}
+@!p,@!q,@!r:pointer; {for list manipulation}
+ at z
+
 @x
+@ @<Expand a nonmacro@>=
+ at y
+@ @<Glob...@>=
+@!is_in_csname: boolean;
+
+@ @<Set init...@>=
+is_in_csname := false;
+
+@ @<Expand a nonmacro@>=
+ at z
+
+ at x
 no_expand:@<Suppress expansion of the next token@>;
 @y
 no_expand: if cur_chr=0 then @<Suppress expansion of the next token@>
@@ -715,6 +739,22 @@
 end
 @z
 
+ at x
+begin r:=get_avail; p:=r; {head of the list of characters}
+repeat get_x_token;
+ at y
+begin r:=get_avail; p:=r; {head of the list of characters}
+b := is_in_csname; is_in_csname := true;
+repeat get_x_token;
+ at z
+
+ at x
+@<Look up the characters of list |r| in the hash table, and set |cur_cs|@>;
+ at y
+is_in_csname := b;
+@<Look up the characters of list |r| in the hash table, and set |cur_cs|@>;
+ at z
+
 @x scan_keyword
 @!k:pool_pointer; {index into |str_pool|}
 begin p:=backup_head; link(p):=null; k:=str_start[s];
@@ -1032,12 +1072,13 @@
 normal_deviate_code:      print_int(norm_rand);
 @z
 
- at x \[if]pdfprimitive
- at d if_mbox_code=if_dbox_code+1 { `\.{\\ifmbox}' }
+ at x e-pTeX: if primitives - leave room for \ifincsname
+ at d if_tdir_code=if_case_code+4 { `\.{\\iftdir}' }
 @y
- at d if_mbox_code=if_dbox_code+1 { `\.{\\ifmbox}' }
+ at d if_in_csname_code=20 { `\.{\\ifincsname}';  |if_font_char_code| + 1 }
+ at d if_pdfprimitive_code=21 { `\.{\\ifpdfprimitive}' }
 @#
- at d if_pdfprimitive_code=if_mbox_code+1 { `\.{\\ifpdfprimitive}' }
+ at d if_tdir_code=if_pdfprimitive_code+1 { `\.{\\iftdir}' }
 @z
 
 @x \[if]pdfprimitive
@@ -1047,6 +1088,15 @@
   if_pdfprimitive_code:print_esc("ifpdfprimitive");
 @z
 
+ at x \ifincsname
+var b:boolean; {is the condition true?}
+@!r:"<"..">"; {relation to be evaluated}
+ at y
+var b:boolean; {is the condition true?}
+@!e:boolean; {keep track of nested csnames}
+@!r:"<"..">"; {relation to be evaluated}
+ at z
+
 @x \[if]pdfprimitive
 if_void_code, if_hbox_code, if_vbox_code, if_tbox_code, if_ybox_code, if_dbox_code, if_mbox_code:
   @<Test box register status@>;
@@ -1295,6 +1345,46 @@
 @z
 
 @x
+primitive("iffontchar",if_test,if_font_char_code);
+@!@:if_font_char_}{\.{\\iffontchar} primitive@>
+ at y
+primitive("iffontchar",if_test,if_font_char_code);
+@!@:if_font_char_}{\.{\\iffontchar} primitive@>
+primitive("ifincsname",if_test,if_in_csname_code);
+@!@:if_in_csname_}{\.{\\ifincsname} primitive@>
+ at z
+
+ at x
+if_font_char_code:print_esc("iffontchar");
+ at y
+if_font_char_code:print_esc("iffontchar");
+if_in_csname_code:print_esc("ifincsname");
+ at z
+
+ at x
+if_cs_code:begin n:=get_avail; p:=n; {head of the list of characters}
+  repeat get_x_token;
+ at y
+if_cs_code:begin n:=get_avail; p:=n; {head of the list of characters}
+ e := is_in_csname; is_in_csname := true;
+  repeat get_x_token;
+ at z
+
+ at x
+  b:=(eq_type(cur_cs)<>undefined_cs);
+ at y
+  b:=(eq_type(cur_cs)<>undefined_cs);
+  is_in_csname := e;
+ at z
+
+ at x
+if_font_char_code:begin scan_font_ident; n:=cur_val;
+ at y
+if_in_csname_code: b := is_in_csname;
+if_font_char_code:begin scan_font_ident; n:=cur_val;
+ at z
+
+ at x
 procedure print_kanji(@!s:KANJI_code); {prints a single character}
 begin
 if s>255 then

Added: trunk/Build/source/texk/web2c/eptexdir/tests/fontchar.sh
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/tests/fontchar.sh	                        (rev 0)
+++ trunk/Build/source/texk/web2c/eptexdir/tests/fontchar.sh	2019-07-12 16:08:21 UTC (rev 51624)
@@ -0,0 +1,2 @@
+#!/bin/sh
+luatex zero_search.tex && ppltotf zero_search.pl && eptex fontchar


Property changes on: trunk/Build/source/texk/web2c/eptexdir/tests/fontchar.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/texk/web2c/eptexdir/tests/fontchar.tex
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/tests/fontchar.tex	                        (rev 0)
+++ trunk/Build/source/texk/web2c/eptexdir/tests/fontchar.tex	2019-07-12 16:08:21 UTC (rev 51624)
@@ -0,0 +1,61 @@
+%#!eptex
+
+\catcode`\_=12 \catcode`\@=11
+\def\typeout{\immediate\write17}
+\begingroup
+  \catcode`\P=12 \catcode`\T=12
+  \lowercase{
+	\gdef\rem at pt#1.#2PT{#1\ifnum#2>\z at .#2\fi}
+  }
+\endgroup
+\def\strip at pt{\expandafter\rem at pt\the}
+
+\def\TFC#1{\typeout{code #1: \iffontchar\jfont#1 T\else F\fi}}
+\def\TFT#1#2{\typeout{type \the\numexpr-#1-1\relax:
+  \iffontchar#2#1
+	(\strip at pt\fontcharht#2#1+\strip at pt\fontchardp#2#1)*\strip at pt\fontcharwd#2#1
+  \else F\fi
+}}
+
+\TFC{"A1A1}
+\TFC{"FEFE}
+\TFC{"E0A1}
+\TFC{"FCFC}
+\TFC{"8140}
+\TFC{"9FFC}
+
+\typeout{TEST: \string\jfont: \fontname\sevenmin}
+\sevenmin
+\count@=-1
+\loop \ifnum\count@>-15
+  \TFT\count@\jfont\advance\count@\m at ne
+\repeat
+
+\typeout{TEST: \string\tfont: \fontname\tfont}
+\count@=-1
+\loop \ifnum\count@>-15
+  \TFT\count@\tfont\advance\count@\m at ne
+\repeat
+
+\protected\def\NEXT{\ten=1
+  \loop\ifnum\ten<95
+    \ifdim\fontcharwd\zs\kuten\numexpr\ku*256+\ten=10pt
+	  \global\count@=\kuten\numexpr\ku*256+\ten
+	  \global\count0\ku \global\count2\ten
+	  \global\ku=95 \ten=95
+	\fi
+    \advance\ten1
+  \repeat}
+\count@=0
+\jfont\zs=zero_search
+\newcount\ku
+\newcount\ten
+\ku=1
+\loop\ifnum\ku<95
+  {\ifnum11=\ifnum\ku>8 1\else0\fi\ifnum\ku<16 1\else 0\fi\else\NEXT\fi}%
+  \advance\ku1
+\repeat
+\kansujichar1=\count@
+\typeout{\kansuji1(internal code: \the\count@, \the\count0-ku \the\count2-ten)}
+
+\bye


Property changes on: trunk/Build/source/texk/web2c/eptexdir/tests/fontchar.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Build/source/texk/web2c/eptexdir/tests/zero_search.tex
===================================================================
--- trunk/Build/source/texk/web2c/eptexdir/tests/zero_search.tex	                        (rev 0)
+++ trunk/Build/source/texk/web2c/eptexdir/tests/zero_search.tex	2019-07-12 16:08:21 UTC (rev 51624)
@@ -0,0 +1,72 @@
+%#!luatex
+\input luatexja.sty
+
+\catcode\endlinechar=12
+\catcode`\ =12
+\catcode`\%=12
+\catcode`\#=12
+\directlua{
+local f = io.open("zero_search.pl", "w")
+if f then
+  function OUT(s) f:write(s .. string.char(10)) end
+else
+  function OUT(s) end
+end
+local jisx0208 = luatexja.base.load_cache('ltj-jisx0208',
+  function() return false end)
+local utf = unicode.utf8
+OUT([[
+(COMMENT THIS IS A KANJI FORMAT FILE)
+(DESIGNSIZE R 10.0)
+(COMMENT DESIGNSIZE IS IN POINTS)
+(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)
+(CHECKSUM O 0)
+(FONTDIMEN
+   (SLANT R 0.0)
+   (SPACE R 0.0)
+   (STRETCH R 0.0)
+   (SHRINK R 0.0)
+   (XHEIGHT R 1.0)
+   (QUAD R 1.0)
+   (EXTRASPACE R 0.0)
+   (EXTRASTRETCH R 0.0)
+   (EXTRASHRINK R 0.0)
+   )]])
+local CNT=96
+local r = {}
+for i=1,94 do
+  for j=1,94 do
+    if not ((i>0x08 and i<0x10) or i>0x54) then
+      local t = math.random( ((i>0x40) and 0 or 1), CNT-1)
+	  r[t] = r[t] or {}
+	  table.insert(r[t],0x2020+i*256+j)
+	end
+  end
+end
+local floor = math.floor
+for i=1,CNT-1 do
+  if #(r[i])>0 then
+    table.sort(r[i])
+	OUT("(CHARSINTYPE D " .. tostring(i))
+    local s, k = "   ", 0
+	for j=1,#(r[i]) do
+	  local f = r[i][j]
+	  k, s = k+1, s .. 'J ' .. string.format("%04X",f)
+	  if k%10==0 then OUT(s); s = "   " else s = s .. " " end
+	end
+	if k%10>0 then OUT(s) end
+	OUT("   )")
+  end
+end
+for i=0,CNT-1 do
+  if #(r[i])>0 then
+    OUT("(TYPE D " .. tostring(i))
+	OUT("   (CHARWD R " .. tostring(1+i/100) .. ")")
+	OUT("   (CHARHT R 0.88)")
+	OUT("   (CHARDP R 0.12)")
+	OUT("   )")
+  end
+end
+f:close()
+}
+\bye


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


More information about the tex-live-commits mailing list