texlive[60474] Build/source/texk/web2c/pdftexdir: import thanh

commits+karl at tug.org commits+karl at tug.org
Sat Sep 11 03:11:45 CEST 2021


Revision: 60474
          http://tug.org/svn/texlive?view=revision&revision=60474
Author:   karl
Date:     2021-09-11 03:11:44 +0200 (Sat, 11 Sep 2021)
Log Message:
-----------
import thanh autokern + hyphenation fixes, pdftex r861-863

Revision Links:
--------------
    http://tug.org/svn/texlive?view=revision&revision=861

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
    trunk/Build/source/texk/web2c/pdftexdir/NEWS
    trunk/Build/source/texk/web2c/pdftexdir/pdftex.web

Modified: trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/ChangeLog	2021-09-10 23:50:15 UTC (rev 60473)
+++ trunk/Build/source/texk/web2c/pdftexdir/ChangeLog	2021-09-11 01:11:44 UTC (rev 60474)
@@ -1,8 +1,26 @@
+2021-09-03  Thanh Han The  <hanthethanh at gmail.com>
+
+	* pdftex.web (prev_tail): new global.
+	(tail_append): maintain it.
+	(insert_before_tail): new macro.
+	(If |tmp_k1| is not null...): insert auto-kern before a
+	null discretionary inserted by |wrapup| (i.e., explicit hyphen)
+	if appropriate. Report (2) from Robert Schlicht.
+	https://mailman.ntg.nl/pipermail/ntg-pdftex/2021-August/004338.html
+	
+2021-09-03  Thanh Han The  <hanthethanh at gmail.com>
+
+	* pdftex.web (append_discretionary): insert autokern
+	(\pdfprependkern/pdfappendkern) after
+	hyphen char inserted by hyphenation. Report (3) from Robert Schlicht.
+	https://mailman.ntg.nl/pipermail/ntg-pdftex/2021-August/004338.html
+
 2021-08-21  Thanh Han The  <hanthethanh at gmail.com>
 
 	* pdftex.web (cp_skipable): make autokerns "skipable", so character
 	protrusion works with chars having autokern
-	(\pdfprependkern/\pdfappendkern).
+	(\pdfprependkern/\pdfappendkern). Report (1) and patch from
+	Robert Schlicht,
 	https://mailman.ntg.nl/pipermail/ntg-pdftex/2021-August/004338.html
 
 2021-07-13  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>

Modified: trunk/Build/source/texk/web2c/pdftexdir/NEWS
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/NEWS	2021-09-10 23:50:15 UTC (rev 60473)
+++ trunk/Build/source/texk/web2c/pdftexdir/NEWS	2021-09-11 01:11:44 UTC (rev 60474)
@@ -6,7 +6,7 @@
   - make .fmt files sharable between 4/8-byte architectures.
   - for \letterspacefont, avoid problem with single-character control sequence.
   - for characters with autokern (\pdfappendkern and \pdfprependkern),
-    still do protrusion.
+    still do protrusion; likewise autokern implicit and explicit hyphens.
   
 pdfTeX 3.141592653-2.6-1.40.22 (TeX Live 2021) (March 23, 2021)
 - changes:

Modified: trunk/Build/source/texk/web2c/pdftexdir/pdftex.web
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/pdftex.web	2021-09-10 23:50:15 UTC (rev 60473)
+++ trunk/Build/source/texk/web2c/pdftexdir/pdftex.web	2021-09-11 01:11:44 UTC (rev 60474)
@@ -4983,11 +4983,17 @@
 @!shown_mode:-mmode..mmode; {most recent mode shown by \.{\\tracingcommands}}
 @!save_tail: pointer; {save |tail| so we can examine whether we have an auto
                        kern before a glue}
+@!prev_tail: pointer; {value of |tail| before the last call to |tail_append|}
 
 @ Here is a common way to make the current list grow:
 
- at d tail_append(#)==begin link(tail):=#; tail:=link(tail);
+ at d tail_append(#)==begin prev_tail:=tail; link(tail):=#; tail:=link(tail);
   end
+ at d insert_before_tail(#) == begin
+    link(prev_tail) := #;
+    link(#) := tail;
+    prev_tail := #;
+end
 
 @ We will see later that the vertical list at the bottom semantic level is split
 into two parts; the ``current page'' runs from |page_head| to |page_tail|,
@@ -24389,7 +24395,8 @@
             (replace_count(#) = 0)) {an empty |disc_node|}
         or ((type(#) = math_node) and (width(#) = 0))
         or ((type(#) = kern_node) and
-            ((width(#) = 0) or (subtype(#) = normal) or (subtype(#) = auto_kern)))
+            ((width(#) = 0) or (subtype(#) = normal)
+             or (subtype(#) = auto_kern)))
         or ((type(#) = glue_node) and (glue_ptr(#) = zero_glue))
         or ((type(#) = hlist_node) and (width(#) = 0) and (height(#) = 0) and
             (depth(#) = 0) and (list_ptr(#) = null))
@@ -28824,9 +28831,20 @@
 
 @ @<If |tmp_k1| is not null then append that kern@>=
 if tmp_k1 <> null then begin
-    wrapup(rt_hit);
+    wrapup(rt_hit); {Note: |wrapup| might insert a null discretionary}
     save_tail := tail;
-    tail_append(tmp_k1);
+    {insert auto-kern before a null discretionary inserted by |wrapup| if appropriate}
+    if (not is_char_node(tail))
+        and (type(tail) = disc_node)
+        and (replace_count(tail) = 0)
+        and (pre_break(tail) = null)
+        and (post_break(tail) = null)
+        and (link(prev_tail) = tail) then
+    begin
+        insert_before_tail(tmp_k1);
+    end
+    else
+        tail_append(tmp_k1);
     goto main_loop_move;
 end
 
@@ -30044,10 +30062,27 @@
 @<Declare act...@>=
 procedure append_discretionary;
 var c:integer; {hyphen character}
+    app_kern, pre_kern, p, c_node: pointer;
 begin tail_append(new_disc);
 if cur_chr=1 then
   begin c:=hyphen_char[cur_font];
-  if c>=0 then if c<256 then pre_break(tail):=new_character(cur_font,c);
+  if c>=0 then if c<256 then begin
+    pre_kern := get_auto_kern(cur_font, non_char, c);
+    app_kern := get_auto_kern(cur_font, c, non_char);
+    c_node := new_character(cur_font,c);
+    if (app_kern = null) and (pre_kern = null) then {no auto-kern}
+        pre_break(tail) := c_node
+    else begin
+        if pre_kern = null then
+            pre_break(tail) := c_node
+        else begin
+            pre_break(tail) := pre_kern;
+            link(pre_kern) := c_node;
+        end;
+        if app_kern <> null then
+            link(c_node) := app_kern;
+    end;
+  end;
   end
 else  begin incr(save_ptr); saved(-1):=0; new_save_level(disc_group);
   scan_left_brace; push_nest; mode:=-hmode; space_factor:=1000;



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