[latex3-commits] [git/LaTeX3-latex3-luaotfload] harf-dev: Fix bugs (c7081f3)
Marcel Fabian Krüger
tex at 2krueger.de
Tue Sep 17 15:00:18 CEST 2019
Repository : https://github.com/latex3/luaotfload
On branch : harf-dev
Link : https://github.com/latex3/luaotfload/commit/c7081f38d379b4699a6caac428d2fc7a5b26447a
>---------------------------------------------------------------
commit c7081f38d379b4699a6caac428d2fc7a5b26447a
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date: Tue Sep 17 14:57:34 2019 +0200
Fix bugs
>---------------------------------------------------------------
c7081f38d379b4699a6caac428d2fc7a5b26447a
src/harf/harf-load.lua | 4 +---
src/harf/harf-node.lua | 10 +++++-----
2 files changed, 6 insertions(+), 8 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 abdc9b3..29387d9 100644
--- a/src/harf/harf-node.lua
+++ b/src/harf/harf-node.lua
@@ -40,7 +40,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
@@ -175,10 +175,10 @@ local function itemize(head, fontid, direction)
local skip = false
if id == glyphid 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 == glueid and subtype == spaceskip then
code = 0x0020 -- SPACE
@@ -762,7 +762,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