diff options
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua')
-rw-r--r-- | Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua index 0fe8a281c66..a54ef20e9d5 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua @@ -5,8 +5,8 @@ local ProvidesLuaModule = { name = "luaotfload-features", - version = "3.12", --TAGVERSION - date = "2020-02-02", --TAGDATE + version = "3.13", --TAGVERSION + date = "2020-05-01", --TAGDATE description = "luaotfload submodule / features", license = "GPL v2.0", author = "Hans Hagen, Khaled Hosny, Elie Roux, Philipp Gesang, Marcel Krüger", @@ -69,11 +69,11 @@ local stringgsub = string.gsub local stringformat = string.format local stringis_empty = string.is_empty -local cmp_by_idx = function (a, b) return a.idx < b.idx end +local function cmp_by_idx (a, b) return a.idx < b.idx end local defined_combos = 0 -local handle_combination = function (combo, spec) +local function handle_combination (combo, spec) defined_combos = defined_combos + 1 if not combo [1] then report ("both", 0, "features", @@ -151,7 +151,7 @@ local handle_combination = function (combo, spec) local src = fnt.characters local cnt = 0 - local pickchr = function (uc, unavailable) + local function pickchr (uc, unavailable) local chr = src [uc] if unavailable == true and basechar [uc] then --- fallback mode: already known @@ -202,7 +202,7 @@ end ---[[ begin excerpt from font-ott.lua ]] -local swapped = function (h) +local function swapped (h) local r = { } for k, v in next, h do r[stringgsub(v,"[^a-z0-9]","")] = k -- is already lower @@ -242,7 +242,7 @@ local support_incomplete = tabletohash({ --doc]]-- --- (string, string) dict -> (string, string) dict -local apply_default_features = function (rawlist) +local function apply_default_features (rawlist) local speclist = {} for k, v in pairs(rawlist) do if type(v) == 'string' then @@ -327,7 +327,7 @@ local supported = { } --- (string | (string * string) | bool) list -> (string * number) -local handle_slashed = function (modifiers) +local function handle_slashed (modifiers) local style, optsize for i=1, #modifiers do local mod = modifiers[i] @@ -356,7 +356,7 @@ do end --- spec -> spec -local handle_request = function (specification) +local function handle_request (specification) local request = lpegmatch(luaotfload.parsers.font_request, specification.specification) ----inspect(request) @@ -569,7 +569,7 @@ local autofeatures = { { "!!??", interrolig_specification, "interrobang substitutions" }, } -local add_auto_features = function () +local function add_auto_features () local nfeats = #autofeatures report ("both", 5, "features", "auto-installing %d feature definitions", nfeats) @@ -582,6 +582,26 @@ end luaotfload.apply_default_features = apply_default_features +do + local function mathparaminitializer(tfmdata, value, features) + if not next(tfmdata.mathparameters) then return end + if value == 'auto' then + if features.script == 'math' then return end + end + tfmdata.mathparameters = {} + end + fonts.constructors.features.otf.register { + name = 'nomathparam', + description = 'Set Math parameters based on this font', + default = 'auto', + initializers = { + base = mathparaminitializer, + node = mathparaminitializer, + -- plug = mathparaminitializer, + }, + } +end + return function () if not fonts and fonts.handlers then report ("log", 0, "features", |