From c452fefcdf8316b946ed64c9849342cc012b7394 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 17 Apr 2016 13:12:09 +0200 Subject: [features] fix buggy state check --- src/luaotfload-features.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/luaotfload-features.lua') diff --git a/src/luaotfload-features.lua b/src/luaotfload-features.lua index 250fbc8..2148019 100644 --- a/src/luaotfload-features.lua +++ b/src/luaotfload-features.lua @@ -36,12 +36,11 @@ local config = config or { luaotfload = { run = { } } } local as_script = true local normalize = function () end -if config.luaotfload.run.live == true then +if config.luaotfload.run.live ~= false then normalize = handlers.otf.features.normalize as_script = false end - --HH A bit of tuning for definitions. if fonts.constructors then -- cgit v1.2.3 From ec774e0e4d16ed440e6b892a7325b304aec82e71 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 17 Apr 2016 21:41:09 +0200 Subject: [features] adjust feature processor to new data structures --- src/luaotfload-features.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/luaotfload-features.lua') diff --git a/src/luaotfload-features.lua b/src/luaotfload-features.lua index 2148019..16422db 100644 --- a/src/luaotfload-features.lua +++ b/src/luaotfload-features.lua @@ -1853,12 +1853,18 @@ otf.addfeature = add_otf_feature local install_extra_features = function (data, filename, raw) for feature, specification in next, extrafeatures do + local fontname + local subfont + local metadata = data.metadata + if metadata then + fontname = tostring (data.metadata.fontname) + subfont = tonumber (metadata.subfontindex) + end + if not fontname then fontname = "" end + if not subfont then subfont = -1 end logreport ("both", 3, "features", "register synthetic feature ā€œ%sā€ for %s font ā€œ%sā€(%d)", - feature, - data.format, - tostring (data.metadata and data.metadata.fontname or ""), - data.subfont or -1) + feature, data.format, fontname, subfont) otf.features.register { name = feature, description = specification[2] } otf.enhancers.addfeature (data, feature, specification[1]) end -- cgit v1.2.3 From b6569eef1dc488aafbdef8a12ddd68cdef1d5b72 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 17 Apr 2016 22:12:10 +0200 Subject: [features] account for subfont indexing changes The new Lua based loader consistently numbers subfonts from one, not zero like the Fontforge one. We correct the value immediately before passing a handled font request on to the loader. --- src/luaotfload-features.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/luaotfload-features.lua') diff --git a/src/luaotfload-features.lua b/src/luaotfload-features.lua index 16422db..9817e0b 100644 --- a/src/luaotfload-features.lua +++ b/src/luaotfload-features.lua @@ -1246,6 +1246,10 @@ local handle_request = function (specification) --- investigated it any further (luatex-fonts-ext), so it will --- just stay here. specification.features.normal = normalize (request.features) + local subfont = tonumber (specification.sub) + if subfont and subfont >= 0 then + specification.sub = subfont + 1 + end return specification end -- cgit v1.2.3