texlive[46500] Build/source/texk/web2c: ptexdir: disp_node insertion,

commits+hironobu at tug.org commits+hironobu at tug.org
Wed Jan 31 12:33:49 CET 2018


Revision: 46500
          http://tug.org/svn/texlive?view=revision&revision=46500
Author:   hironobu
Date:     2018-01-31 12:33:49 +0100 (Wed, 31 Jan 2018)
Log Message:
-----------
ptexdir: disp_node insertion, jfm glue (H. Kitagawa)

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/ptexdir/ChangeLog
    trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
    trunk/Build/source/texk/web2c/uptexdir/ChangeLog
    trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch

Added Paths:
-----------
    trunk/Build/source/texk/web2c/ptexdir/tests/disp_jfm.tex
    trunk/Build/source/texk/web2c/ptexdir/tests/disp_unbox.tex

Modified: trunk/Build/source/texk/web2c/ptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2018-01-31 01:18:04 UTC (rev 46499)
+++ trunk/Build/source/texk/web2c/ptexdir/ChangeLog	2018-01-31 11:33:49 UTC (rev 46500)
@@ -1,3 +1,13 @@
+2018-01-31  Hironori Kitagawa  <h_kitagawa2001 at yahoo.co.jp>
+
+	* ptex-base.ch: Fix issue GitHub:texjporg/tex-jp-build#40
+	 - Insert a disp_node before the first character in a
+	   paragraph or an hbox, if disp_node is not inserted yet
+	   in the current list (in case it is unboxed).
+	 - Inhibit JFM glue after a disp_node at the very beginning of
+	   a paragraph or an hbox.
+	* tests/disp_jfm.tex, tests/disp_unbox.tex: Added.
+
 2018-01-27  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
 
 	* ppltotf.ch, ptftopl.ch: Introduce a new JFM spec, to allow

Modified: trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch	2018-01-31 01:18:04 UTC (rev 46499)
+++ trunk/Build/source/texk/web2c/ptexdir/ptex-base.ch	2018-01-31 11:33:49 UTC (rev 46500)
@@ -998,6 +998,7 @@
   @!dir_field,@!adj_dir_field: -dir_yoko..dir_yoko;
   @!pdisp_field: scaled;
   @!head_field,@!tail_field,@!pnode_field,@!last_jchr_field: pointer;
+  @!disp_called_field: boolean;
 @z
 
 @x [16.213] l.4445 - pTeX: last_jchr, direction, adjust_dir, prev_{node,disp}
@@ -1011,6 +1012,7 @@
 @d prev_node==cur_list.pnode_field {previous to last |disp_node|}
 @d prev_disp==cur_list.pdisp_field {displacemant at |prev_node|}
 @d last_jchr==cur_list.last_jchr_field {final jchar node on current list}
+ at d disp_called==cur_list.disp_called_field {is a |disp_node| present in the current list?}
 @z
 
 @x [16.214] l.4464 - pTeX: prev_append: disp_node
@@ -1029,6 +1031,7 @@
 @y
 mode:=vmode; head:=contrib_head; tail:=contrib_head; prev_node:=tail;
 direction:=dir_yoko; adjust_dir:=direction; prev_disp:=0; last_jchr:=null;
+disp_called:=false;
 @z
 
 @x [16.216] l.4496 - pTeX: last_jchr, displacement.
@@ -1035,7 +1038,7 @@
 incr(nest_ptr); head:=get_avail; tail:=head; prev_graf:=0; mode_line:=line;
 @y
 incr(nest_ptr); head:=new_null_box; tail:=head; prev_node:=tail;
-prev_graf:=0; prev_disp:=0; last_jchr:=null; mode_line:=line;
+prev_graf:=0; prev_disp:=0; disp_called:=false; last_jchr:=null; mode_line:=line;
 @z
 
 @x [16.217] l.4504 - pTeX: pop_nest last_jchr
@@ -4447,7 +4450,7 @@
 if last_disp<>0 then begin
   r:=get_node(small_node_size);
   type(r):=disp_node; disp_dimen(r):=last_disp;
-  link(r):=q; q:=r;
+  link(r):=q; q:=r; disp_called:=true;
   end;
 @z
 
@@ -7127,7 +7130,11 @@
 @#
 main_loop_j+1: space_factor:=1000;
   if main_f<>null_font then
-    begin fast_get_avail(main_p); font(main_p):=main_f; character(main_p):=cur_l;
+    begin if not disp_called then
+      begin prev_node:=tail; tail_append(get_node(small_node_size));
+      type(tail):=disp_node; disp_dimen(tail):=0; disp_called:=true
+	  end;
+	fast_get_avail(main_p); font(main_p):=main_f; character(main_p):=cur_l;
     link(tail):=main_p; tail:=main_p; last_jchr:=tail;
     fast_get_avail(main_p); info(main_p):=KANJI(cur_chr);
     link(tail):=main_p; tail:=main_p;
@@ -7190,9 +7197,10 @@
   else disp_dimen(tail):=disp;
   end
 else
-  if disp<>0 then
+  if disp<>0 or not disp_called then
     begin prev_node:=tail; tail_append(get_node(small_node_size));
     type(tail):=disp_node; disp_dimen(tail):=disp; prev_disp:=disp;
+	disp_called:=true
     end;
 end;
 
@@ -7204,6 +7212,7 @@
 else
   begin prev_node:=tail; tail_append(get_node(small_node_size));
   type(tail):=disp_node; disp_dimen(tail):=0; prev_disp:=disp;
+  disp_called:=true
   end;
 end;
 
@@ -7210,7 +7219,9 @@
 @ @<Look ahead for glue or kerning@>=
 cur_q:=tail;
 if inhibit_glue_flag<>true then
-  begin if char_tag(main_i)=gk_tag then
+  begin if (tail=link(head))and(not is_char_node(tail))and(type(tail)=disp_node) then
+    goto skip_loop
+  else begin if char_tag(main_i)=gk_tag then
     begin main_k:=glue_kern_start(main_f)(main_i);
     repeat main_j:=font_info[main_k].qqqq;
     if next_char(main_j)=cur_l then
@@ -7245,6 +7256,7 @@
   incr(main_k);
   until skip_byte(main_j)>=stop_flag;
   end;
+  end;
 end;
 skip_loop: inhibit_glue_flag:=false;
 

Added: trunk/Build/source/texk/web2c/ptexdir/tests/disp_jfm.tex
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/tests/disp_jfm.tex	                        (rev 0)
+++ trunk/Build/source/texk/web2c/ptexdir/tests/disp_jfm.tex	2018-01-31 11:33:49 UTC (rev 46500)
@@ -0,0 +1,23 @@
+%% plain pTeX
+\tracingonline1
+\showboxdepth10000
+\showboxbreadth10000
+
+\def\ADJUST{\ybaselineshift3pt\relax}
+
+% disp_node should not create JFM glue
+\setbox0=\vbox{%
+\ADJUST
+\noindent 「あA\par
+\noindent 「あA」\par
+\noindent 「あA\par
+\noindent いEお()\par
+\noindent ・えE\par
+\noindent ・うE}\showbox0 \box0
+
+% disp_node should not create JFM glue
+\ybaselineshift2pt
+\xkanjiskip2pt
+\setbox6=\vbox{あA\hbox{(あ)}A\par}\showbox6 \box6
+
+\end


Property changes on: trunk/Build/source/texk/web2c/ptexdir/tests/disp_jfm.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Build/source/texk/web2c/ptexdir/tests/disp_unbox.tex
===================================================================
--- trunk/Build/source/texk/web2c/ptexdir/tests/disp_unbox.tex	                        (rev 0)
+++ trunk/Build/source/texk/web2c/ptexdir/tests/disp_unbox.tex	2018-01-31 11:33:49 UTC (rev 46500)
@@ -0,0 +1,23 @@
+\ybaselineshift10pt
+\parindent5pt
+\showboxbreadth10000
+\showboxdepth10000
+\tracingonline1
+\setbox0=\vbox{\hsize=40pt%
+  {\ybaselineshift0pt oお\par fiか\par
+	\global\setbox4=\lastbox\unskip\unskip
+   	\global\setbox5=\lastbox\unskip\unskip
+  }
+  \leavevmode\hbox{}いi\par uう\par えe\par
+  \setbox1=\lastbox\unskip\unskip
+  \setbox2=\lastbox\unskip\unskip
+  \setbox3=\lastbox\unskip\unskip
+
+  \hsize=200pt
+  \leavevmode\unhcopy3\unhcopy1\unhcopy4\unhcopy5\unhcopy2
+
+  %\showbox1\showbox2\showbox3\showbox4\showbox5
+}\unvbox0
+
+\end
+


Property changes on: trunk/Build/source/texk/web2c/ptexdir/tests/disp_unbox.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Build/source/texk/web2c/uptexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/ChangeLog	2018-01-31 01:18:04 UTC (rev 46499)
+++ trunk/Build/source/texk/web2c/uptexdir/ChangeLog	2018-01-31 11:33:49 UTC (rev 46500)
@@ -1,3 +1,7 @@
+2018-01-31  Hironori Kitagawa  <h_kitagawa2001 at yahoo.co.jp>
+
+	* uptex-m.ch: Adapt to changes in ptexdir/ptex-base.ch (disp_node).
+
 2018-01-27  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
 
 	* uppltotf.ch, uptftopl.ch, uptex-m.ch: Adapt to the new JFM spec.

Modified: trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch
===================================================================
--- trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch	2018-01-31 01:18:04 UTC (rev 46499)
+++ trunk/Build/source/texk/web2c/uptexdir/uptex-m.ch	2018-01-31 11:33:49 UTC (rev 46500)
@@ -1177,12 +1177,8 @@
 @z
 
 @x
-    begin fast_get_avail(main_p); font(main_p):=main_f; character(main_p):=cur_l;
-    link(tail):=main_p; tail:=main_p; last_jchr:=tail;
     fast_get_avail(main_p); info(main_p):=KANJI(cur_chr);
 @y
-    begin fast_get_avail(main_p); font(main_p):=main_f; character(main_p):=cur_l;
-    link(tail):=main_p; tail:=main_p; last_jchr:=tail;
     fast_get_avail(main_p); info(main_p):=KANJI(cur_chr)+cur_cmd*max_cjk_val;
 @z
 



More information about the tex-live-commits mailing list