diff options
author | Karl Berry <karl@freefriends.org> | 2021-09-11 01:11:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-09-11 01:11:44 +0000 |
commit | 3723b2d2861a6be60712d557018ab5345ab431a9 (patch) | |
tree | 178407d8dc8446ee8e706cfea39acefb7ae924a3 /Build/source/texk/web2c/pdftexdir/pdftex.web | |
parent | c0a14288336ccdaf8bbd1830958cc5fcbfed106d (diff) |
import thanh autokern + hyphenation fixes, pdftex r861-863
git-svn-id: svn://tug.org/texlive/trunk@60474 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/pdftexdir/pdftex.web')
-rw-r--r-- | Build/source/texk/web2c/pdftexdir/pdftex.web | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/pdftex.web b/Build/source/texk/web2c/pdftexdir/pdftex.web index 99ccc6511f5..44f464420fe 100644 --- a/Build/source/texk/web2c/pdftexdir/pdftex.web +++ b/Build/source/texk/web2c/pdftexdir/pdftex.web @@ -4983,11 +4983,17 @@ be pushed onto |nest| if necessary. @!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: -@d tail_append(#)==begin link(tail):=#; tail:=link(tail); +@d tail_append(#)==begin prev_tail:=tail; link(tail):=#; tail:=link(tail); end +@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 @@ distinguishable by the condition |cur_p=null|. (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 @@ goto main_lig_loop+1 @ @<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 @@ but it starts out as 1000 in the subsidiary lists. @<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; |