[latex3-commits] [git/LaTeX3-latex3-luaotfload] harf-dev: Fix bugs (fed6d48)

Marcel Fabian Krüger tex at 2krueger.de
Tue Sep 17 16:31:37 CEST 2019


Repository : https://github.com/latex3/luaotfload
On branch  : harf-dev
Link       : https://github.com/latex3/luaotfload/commit/fed6d48a10e63b113aa1ab2318290c9daacdba24

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

commit fed6d48a10e63b113aa1ab2318290c9daacdba24
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Tue Sep 17 14:57:34 2019 +0200

    Fix bugs


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

fed6d48a10e63b113aa1ab2318290c9daacdba24
 src/harf/harf-load.lua |  4 +---
 src/harf/harf-node.lua | 11 +++++------
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/harf/harf-load.lua b/src/harf/harf-load.lua
index 5d4acae..72af885 100644
--- a/src/harf/harf-load.lua
+++ b/src/harf/harf-load.lua
@@ -11,9 +11,6 @@ local glyftag = hb.Tag.new("glyf")
 
 local function loadfont(spec)
   local path, sub = spec.resolved, spec.sub or 1
-  if not path then
-    return nil
-  end
 
   local key = string.format("%s:%d", path, sub)
   local data = hbfonts[key]
@@ -308,5 +305,6 @@ local function scalefont(data, spec)
 end
 
 return function(spec)
+  if not spec.resolved then return end
   return scalefont(loadfont(spec), spec)
 end
diff --git a/src/harf/harf-node.lua b/src/harf/harf-node.lua
index aa1f6e4..e551e25 100644
--- a/src/harf/harf-node.lua
+++ b/src/harf/harf-node.lua
@@ -15,7 +15,6 @@ local direct            = node.direct
 local tonode            = direct.tonode
 local todirect          = direct.todirect
 local traverse          = direct.traverse
-local traverseid        = direct.traverse_id
 local insertbefore      = direct.insert_before
 local insertafter       = direct.insert_after
 local protectglyph      = direct.protect_glyph
@@ -52,7 +51,7 @@ local getsubtype        = direct.getsubtype
 local setsubtype        = direct.setsubtype
 local getwidth          = direct.getwidth
 local setwidth          = direct.setwidth
-local uses_font         = direct.uses_font
+local is_char           = direct.is_char
 
 local getpre            = function (n) return getfield(n, "pre")        end
 local setpre            = function (n, v)     setfield(n, "pre", v)     end
@@ -192,10 +191,10 @@ local function itemize(head, fontid, direction)
     local skip = false
 
     if id == glyph_t then
-      if subtype > 255 or not uses_font(n, fontid) then
-        skip = true
-      else
+      if is_char(n) and getfont(n) == fontid then
         code = getchar(n)
+      else
+        skip = true
       end
     elseif id == glue_t and subtype == spaceskip_t then
       code = 0x0020 -- SPACE
@@ -781,7 +780,7 @@ local function shape_run(head, current, run)
   return head, current
 end
 
-process = function(head, font, direction)
+function process(head, font, direction)
   local newhead, current = nil, nil
   local runs = itemize(head, font, direction)
 





More information about the latex3-commits mailing list