summaryrefslogtreecommitdiff
path: root/src/luaotfload-features.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-07-13 15:01:59 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2014-07-13 15:01:59 +0200
commitd84ce4ec794e634b853ca88925e1d20f6a1287e3 (patch)
tree57a3de8cbd900e45061820353391124bf2c41663 /src/luaotfload-features.lua
parente8b0693cc014c201a600aed32cec71044a72edce (diff)
downloadluaotfload-d84ce4ec794e634b853ca88925e1d20f6a1287e3.tar.gz
[features,conf] generalize feature option parsing
Diffstat (limited to 'src/luaotfload-features.lua')
-rw-r--r--src/luaotfload-features.lua13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/luaotfload-features.lua b/src/luaotfload-features.lua
index 0dc7d0a..1fb6d7c 100644
--- a/src/luaotfload-features.lua
+++ b/src/luaotfload-features.lua
@@ -724,6 +724,8 @@ local support_incomplete = tabletohash({
--- (string, string) dict -> (string, string) dict
local set_default_features = function (speclist)
+ local default_features = luaotfload.features
+
speclist = speclist or { }
speclist[""] = nil --- invalid options stub
@@ -760,20 +762,19 @@ local set_default_features = function (speclist)
"Auto-selecting default features for script: %s.",
script)
- local requested = luaotfload.features.defaults[script]
+ local requested = default_features.defaults[script]
if not requested then
report("log", 1, "load",
"No default features for script %q, falling back to \"dflt\".",
script)
- requested = luaotfload.features.defaults.dflt
+ requested = default_features.defaults.dflt
end
- for i=1, #requested do
- local feat = requested[i]
- if speclist[feat] ~= false then speclist[feat] = true end
+ for feat, state in next, requested do
+ if not speclist[feat] then speclist[feat] = state end
end
- for feat, state in next, luaotfload.features.global do
+ for feat, state in next, default_features.global do
--- This is primarily intended for setting node
--- mode unless “base” is requested, as stated
--- in the manual.