Skip to content

Commit

Permalink
Expose apply_default_features
Browse files Browse the repository at this point in the history
  • Loading branch information
zauguin committed Dec 11, 2019
1 parent c7c316e commit dada6b6
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/luaotfload-features.lua
Expand Up @@ -240,7 +240,15 @@ local support_incomplete = tabletohash({
--doc]]--
--- (string, string) dict -> (string, string) dict
local apply_default_features = function (speclist)
local apply_default_features = function (rawlist)
local speclist = {}
for k, v in pairs(rawlist) do
if type(v) == 'string' then
v = string.lower(v)
v = ({['true'] = true, ['false'] = false})[v] or v
end
speclist[k] = v
end
local default_features = luaotfload.features
speclist = speclist or { }
Expand Down Expand Up @@ -392,15 +400,7 @@ local handle_request = function (specification)
end
features.raw = request.features or {}
request.features = {}
for k, v in pairs(features.raw) do
if type(v) == 'string' then
v = string.lower(v)
v = ({['true'] = true, ['false'] = false})[v] or v
end
request.features[k] = v
end
request.features = apply_default_features(request.features)
request.features = apply_default_features(features.raw)
if name then
specification.name = name
Expand Down Expand Up @@ -576,6 +576,8 @@ local add_auto_features = function ()
end
end
luaotfload.apply_default_features = apply_default_features
return function ()
if not fonts and fonts.handlers then
report ("log", 0, "features",
Expand Down

0 comments on commit dada6b6

Please sign in to comment.