summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c
diff options
context:
space:
mode:
authorHironobu Yamashita <h.y.acetaminophen@gmail.com>2018-01-31 11:33:49 +0000
committerHironobu Yamashita <h.y.acetaminophen@gmail.com>2018-01-31 11:33:49 +0000
commitf9f3fb5d61ee536eb631c3b5ddee9ab6dc7ec0d4 (patch)
tree83bb5a57614f9c894f09c5ba05b4331ff6d5fd9c /Build/source/texk/web2c
parent7db40b34ea76c33ab5a72546ba925d3ce7bc4dea (diff)
ptexdir: disp_node insertion, jfm glue (H. Kitagawa)
git-svn-id: svn://tug.org/texlive/trunk@46500 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c')
-rw-r--r--Build/source/texk/web2c/ptexdir/ChangeLog10
-rw-r--r--Build/source/texk/web2c/ptexdir/ptex-base.ch22
-rw-r--r--Build/source/texk/web2c/ptexdir/tests/disp_jfm.tex23
-rw-r--r--Build/source/texk/web2c/ptexdir/tests/disp_unbox.tex23
-rw-r--r--Build/source/texk/web2c/uptexdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/uptexdir/uptex-m.ch4
6 files changed, 77 insertions, 9 deletions
diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog
index b185d6952fc..c9232f0c909 100644
--- a/Build/source/texk/web2c/ptexdir/ChangeLog
+++ b/Build/source/texk/web2c/ptexdir/ChangeLog
@@ -1,3 +1,13 @@
+2018-01-31 Hironori Kitagawa <h_kitagawa2001@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@gmail.com>
* ppltotf.ch, ptftopl.ch: Introduce a new JFM spec, to allow
diff --git a/Build/source/texk/web2c/ptexdir/ptex-base.ch b/Build/source/texk/web2c/ptexdir/ptex-base.ch
index 61797a5123b..38b3b57e529 100644
--- a/Build/source/texk/web2c/ptexdir/ptex-base.ch
+++ b/Build/source/texk/web2c/ptexdir/ptex-base.ch
@@ -998,6 +998,7 @@ kern_node,math_node,penalty_node: begin r:=get_node(small_node_size);
@!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 @@ kern_node,math_node,penalty_node: begin r:=get_node(small_node_size);
@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}
+@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,13 +1031,14 @@ mode:=vmode; head:=contrib_head; tail:=contrib_head;
@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.
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 @@ r:=link(q); link(q):=null; q:=link(temp_head); link(temp_head):=r;
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 @@ goto main_loop_j+3;
@#
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 @@ begin if not is_char_node(tail)and(type(tail)=disp_node) then
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,13 +7212,16 @@ begin if not is_char_node(tail)and(type(tail)=disp_node) then
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;
@ @<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 @@ if inhibit_glue_flag<>true then
incr(main_k);
until skip_byte(main_j)>=stop_flag;
end;
+ end;
end;
skip_loop: inhibit_glue_flag:=false;
diff --git a/Build/source/texk/web2c/ptexdir/tests/disp_jfm.tex b/Build/source/texk/web2c/ptexdir/tests/disp_jfm.tex
new file mode 100644
index 00000000000..989bf30df65
--- /dev/null
+++ b/Build/source/texk/web2c/ptexdir/tests/disp_jfm.tex
@@ -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
diff --git a/Build/source/texk/web2c/ptexdir/tests/disp_unbox.tex b/Build/source/texk/web2c/ptexdir/tests/disp_unbox.tex
new file mode 100644
index 00000000000..885cbb28a02
--- /dev/null
+++ b/Build/source/texk/web2c/ptexdir/tests/disp_unbox.tex
@@ -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
+
diff --git a/Build/source/texk/web2c/uptexdir/ChangeLog b/Build/source/texk/web2c/uptexdir/ChangeLog
index c20659e879e..3f8f9a6f0dd 100644
--- a/Build/source/texk/web2c/uptexdir/ChangeLog
+++ b/Build/source/texk/web2c/uptexdir/ChangeLog
@@ -1,3 +1,7 @@
+2018-01-31 Hironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
+
+ * uptex-m.ch: Adapt to changes in ptexdir/ptex-base.ch (disp_node).
+
2018-01-27 Hironobu Yamashita <h.y.acetaminophen@gmail.com>
* uppltotf.ch, uptftopl.ch, uptex-m.ch: Adapt to the new JFM spec.
diff --git a/Build/source/texk/web2c/uptexdir/uptex-m.ch b/Build/source/texk/web2c/uptexdir/uptex-m.ch
index 02c6d5dc44e..b89c1d2bad6 100644
--- a/Build/source/texk/web2c/uptexdir/uptex-m.ch
+++ b/Build/source/texk/web2c/uptexdir/uptex-m.ch
@@ -1177,12 +1177,8 @@ begin if is_char_node(link(p)) then
@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