From 5b4b1a58694f43504741ba798d383ae37d884c2a Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 8 Aug 2014 07:03:29 +0200 Subject: [conf] substitute underscores in section names --- src/luaotfload-configuration.lua | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/luaotfload-configuration.lua b/src/luaotfload-configuration.lua index bf841f7..ec38d90 100644 --- a/src/luaotfload-configuration.lua +++ b/src/luaotfload-configuration.lua @@ -483,6 +483,18 @@ local option_spec = { --- FORMATTERS ------------------------------------------------------------------------------- +local commented = function (str) + return ";" .. str +end + +local underscore_replacer = lpeg.replacer ("_", "-", true) + +local dashed = function (var) + --- INI spec dictates that dashes are valid in variable names, not + --- underscores. + return underscore_replacer (var) or var +end + local indent = " " local format_string = function (var, val) return stringformat (indent .. "%s = %s", var, val) @@ -516,19 +528,7 @@ local format_keyval = function (var, val) end local format_section = function (title) - return stringformat ("[%s]", title) -end - -local commented = function (str) - return ";" .. str -end - -local underscore_replacer = lpeg.replacer ("_", "-", true) - -local dashed = function (var) - --- INI spec dictates that dashes are valid in variable names, not - --- underscores. - return underscore_replacer (var) or var + return stringformat ("[%s]", dashed (title)) end local conf_header = [==[ -- cgit v1.2.3 From 32296e68a23ddb5f035e6991733466ea82231c95 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 8 Aug 2014 07:07:04 +0200 Subject: [features] fix test for missing default feature (Thanks, Kim!) This is a partial revert of 3cf26fc.. -- The test must be for features not specified in the font definition. Also applies in the same manner to the global defaults. --- src/luaotfload-features.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/luaotfload-features.lua b/src/luaotfload-features.lua index f01c45b..9b895ce 100644 --- a/src/luaotfload-features.lua +++ b/src/luaotfload-features.lua @@ -771,14 +771,14 @@ local apply_default_features = function (speclist) end for feat, state in next, requested do - if not speclist[feat] == nil then speclist[feat] = state end + if speclist[feat] == nil then speclist[feat] = state end end 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. - if not speclist[feat] then speclist[feat] = state end + if speclist[feat] == nil then speclist[feat] = state end end return speclist end -- cgit v1.2.3