[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev: Fix multiple discretionaries at start of run (1dcb58c)

Marcel Fabian Krüger tex at 2krueger.de
Thu May 13 12:18:20 CEST 2021


Repository : https://github.com/latex3/luaotfload
On branch  : dev
Link       : https://github.com/latex3/luaotfload/commit/1dcb58cde865cd46d20d695b3414088ea6aee8f0

>---------------------------------------------------------------

commit 1dcb58cde865cd46d20d695b3414088ea6aee8f0
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Wed Mar 10 15:15:44 2021 +0100

    Fix multiple discretionaries  at start of run


>---------------------------------------------------------------

1dcb58cde865cd46d20d695b3414088ea6aee8f0
 src/luaotfload-harf-plug.lua | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/luaotfload-harf-plug.lua b/src/luaotfload-harf-plug.lua
index d949be2..8013704 100644
--- a/src/luaotfload-harf-plug.lua
+++ b/src/luaotfload-harf-plug.lua
@@ -179,7 +179,8 @@ local function itemize(head, fontid, direction)
   local dirstack = {}
   local currdir = direction or 0
   local lastskip, lastdir = true
-  local lastrun = {}
+  local dummyrun = { start = 0, len = 0 }
+  local lastrun = dummyrun
   local lastdisc
   local in_disc
 
@@ -224,9 +225,6 @@ local function itemize(head, fontid, direction)
         setlink(prev, n)
         code = nil
         skip = false
-        if not prev then
-          head = n
-        end
       else
         skip = true
       end
@@ -270,6 +268,9 @@ local function itemize(head, fontid, direction)
       lastrun.len = lastrun.len + 1
     elseif disc then
       if lastdisc then
+        if lastrun.len == 0 then
+          runs[#runs - 1].after = n
+        end
         lastdisc.next = disc
         lastdisc = disc
       else
@@ -278,7 +279,7 @@ local function itemize(head, fontid, direction)
     end
   end
 
-  return head, runs
+  return dummyrun.after, runs
 end
 
 





More information about the latex3-commits mailing list.