[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev, oberdiek-dev: Expose apply_default_features (dada6b6)

Marcel Fabian Krüger tex at 2krueger.de
Wed Dec 11 14:18:51 CET 2019


Repository : https://github.com/latex3/luaotfload
On branches: dev,oberdiek-dev
Link       : https://github.com/latex3/luaotfload/commit/dada6b61c47698370af3b5cd767a2b5c60d3d211

>---------------------------------------------------------------

commit dada6b61c47698370af3b5cd767a2b5c60d3d211
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Tue Dec 10 21:02:50 2019 +0100

    Expose apply_default_features


>---------------------------------------------------------------

dada6b61c47698370af3b5cd767a2b5c60d3d211
 src/luaotfload-features.lua | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/luaotfload-features.lua b/src/luaotfload-features.lua
index b0464cd..6881194 100644
--- a/src/luaotfload-features.lua
+++ b/src/luaotfload-features.lua
@@ -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 { }
@@ -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
@@ -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",





More information about the latex3-commits mailing list