[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev: Add semmiignored nodes for mode=harf (5e1a364)

Marcel Fabian Krüger tex at 2krueger.de
Sat Apr 18 16:45:39 CEST 2020


Repository : https://github.com/latex3/luaotfload
On branch  : dev
Link       : https://github.com/latex3/luaotfload/commit/5e1a36475d2fe902ed3ec51ac0f885129603ec67

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

commit 5e1a36475d2fe902ed3ec51ac0f885129603ec67
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Tue Apr 7 10:16:11 2020 +0200

    Add semmiignored nodes for mode=harf


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

5e1a36475d2fe902ed3ec51ac0f885129603ec67
 src/luaotfload-harf-plug.lua | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/luaotfload-harf-plug.lua b/src/luaotfload-harf-plug.lua
index cbc6877..fb0e9c7 100644
--- a/src/luaotfload-harf-plug.lua
+++ b/src/luaotfload-harf-plug.lua
@@ -181,8 +181,12 @@ local function itemize(head, fontid, direction)
   for n, id, subtype in direct.traverse(head) do
     local code = 0xFFFC -- OBJECT REPLACEMENT CHARACTER
     local skip = lastskip
+    local props = properties[n]
 
-    if id == glyph_t then
+    if props and props.zwnj then
+      code = 0x200C
+      -- skip = false -- Not sure about this, but lastskip should be a bit faster
+    elseif id == glyph_t then
       if is_char(n) and getfont(n) == fontid then
         code = getchar(n)
         skip = false
@@ -407,7 +411,8 @@ function shape(head, firstnode, run)
           local discindex = nil
           local disc = node
           for j = cluster + 1, nextcluster do
-            if getid(disc) == disc_t then
+            local props = properties[disc]
+            if (not (props and props.zwnj)) and getid(disc) == disc_t then
               discindex = j
               break
             end
@@ -666,7 +671,8 @@ local function tonodes(head, node, run, glyphs)
       freenode(oldnode)
       nodeindex = nodeindex + 1
     else
-      if id == glyph_t then
+      if lastprops and lastprops.zwnj and nodeindex == glyph.cluster + 1 then
+      elseif id == glyph_t then
         local done
         local fontglyph = fontglyphs[gid]
         local character = characters[char]





More information about the latex3-commits mailing list.