summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/typo-fln.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-11-29 20:53:37 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2018-11-29 20:53:37 +0100
commit9bd28a3039a458b054459fe1ef80161b107b798f (patch)
treec15bf6aedc4313de999a97bf92dc63b16ca60794 /tex/context/base/mkiv/typo-fln.lua
parent744095aa4676553437db0d71c281a74557a3222f (diff)
downloadcontext-9bd28a3039a458b054459fe1ef80161b107b798f.tar.gz
2018-11-29 19:54:00
Diffstat (limited to 'tex/context/base/mkiv/typo-fln.lua')
-rw-r--r--tex/context/base/mkiv/typo-fln.lua28
1 files changed, 18 insertions, 10 deletions
diff --git a/tex/context/base/mkiv/typo-fln.lua b/tex/context/base/mkiv/typo-fln.lua
index e105b5a11..b67086fbe 100644
--- a/tex/context/base/mkiv/typo-fln.lua
+++ b/tex/context/base/mkiv/typo-fln.lua
@@ -204,7 +204,7 @@ actions[v_line] = function(head,setting)
while start do
local id = getid(start)
if id == glyph_code then
- n = n + 1
+ -- go on
elseif id == disc_code then
-- this could be an option
n = n + 1
@@ -216,7 +216,8 @@ actions[v_line] = function(head,setting)
end
elseif id == kern_code then -- todo: fontkern
-- this could be an option
- elseif n > 0 then
+ elseif id == glue_code then
+ n = n + 1
if try() then
break
end
@@ -253,7 +254,6 @@ actions[v_line] = function(head,setting)
local id = getid(start)
local ok = false
if id == glyph_code then
- n = n + 1
update(start)
elseif id == disc_code then
n = n + 1
@@ -297,18 +297,26 @@ actions[v_line] = function(head,setting)
setdisc(disc,pre,post,replace)
flush_node(disc)
elseif id == glue_code then
- head = insert_node_before(head,start,newpenalty(10000)) -- nobreak
+ n = n + 1
+ if linebreak ~= n then
+ head = insert_node_before(head,start,newpenalty(10000)) -- nobreak
+ end
end
+ local next = getnext(start)
if linebreak == n then
- if trace_firstlines then
- head, start = insert_node_after(head,start,newpenalty(10000)) -- nobreak
- head, start = insert_node_after(head,start,newkern(-65536))
- head, start = insert_node_after(head,start,tracerrule(65536,4*65536,2*65536,"darkblue"))
+ if start ~= head then
+ local where = id == glue_code and getprev(start) or start
+ if trace_firstlines then
+ head, where = insert_node_after(head,where,newpenalty(10000)) -- nobreak
+ head, where = insert_node_after(head,where,newkern(-65536))
+ head, where = insert_node_after(head,where,tracerrule(65536,4*65536,2*65536,"darkblue"))
+ end
+ head, where = insert_node_after(head,where,newpenalty(-10000)) -- break
end
- head, start = insert_node_after(head,start,newpenalty(-10000)) -- break
+ start = next
break
end
- start = getnext(start)
+ start = next
end
end