summaryrefslogtreecommitdiff
path: root/src/luaotfload-features.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2016-04-18 20:53:29 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2016-04-18 20:53:29 +0200
commita119b257eb5ad1a9ce9a9015d082f28fd2a3527e (patch)
treebe6f43d38271684cd8f7e3ce855f69aef3db43ee /src/luaotfload-features.lua
parentc8734018b81eb2120372493a3767617eeaf0299c (diff)
parent0ed66c28f6f48c8250a903bed9abf6aee6d8dd39 (diff)
downloadluaotfload-a119b257eb5ad1a9ce9a9015d082f28fd2a3527e.tar.gz
Merge pull request #331 from phi-gamma/master
current progress on 2.7
Diffstat (limited to 'src/luaotfload-features.lua')
-rw-r--r--src/luaotfload-features.lua21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/luaotfload-features.lua b/src/luaotfload-features.lua
index 250fbc8..9817e0b 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
@@ -1247,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
@@ -1854,12 +1857,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 = "<unknown>" 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 "<unknown>"),
- 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