diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2011-10-08 20:34:06 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2011-10-08 20:34:06 +0200 |
commit | 0d873a7ecdc632bb298cbd15e393866461492ce3 (patch) | |
tree | 49fd28d1d78a4341957f7585d39d32c887d4986f /otfl-font-ltx.lua | |
parent | c1c6e7379acc126d4c026df09333b7fcb65efcbc (diff) | |
download | luaotfload-0d873a7ecdc632bb298cbd15e393866461492ce3.tar.gz |
Enable default features even if no script is selected
Diffstat (limited to 'otfl-font-ltx.lua')
-rw-r--r-- | otfl-font-ltx.lua | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/otfl-font-ltx.lua b/otfl-font-ltx.lua index 26beda1..8e64f38 100644 --- a/otfl-font-ltx.lua +++ b/otfl-font-ltx.lua @@ -93,8 +93,9 @@ defaults.tibt = defaults.khmr defaults.lao = defaults.thai -local function parse_script(script) +local function set_default_features(script) local features + local script = script or "dflt" logs.report("load font", "auto-selecting default features for script: %s", script) if defaults[script] then features = defaults[script] @@ -102,7 +103,9 @@ local function parse_script(script) features = defaults["dflt"] end for _,v in next, features do - list[v] = "yes" + if list[v] ~= false then + list[v] = true + end end end @@ -113,12 +116,7 @@ local function thename(s) list.name = s end local function issub (v) list.sub = v end local function istrue (s) list[s] = true end local function isfalse(s) list[s] = false end -local function iskey (k,v) - if k == "script" then - parse_script(v) - end - list[k] = v -end +local function iskey (k,v) list[k] = v end local P, S, R, C = lpeg.P, lpeg.S, lpeg.R, lpeg.C @@ -141,6 +139,7 @@ local pattern = (filename + fontname) * subvalue^0 * stylespec^0 * options^0 local function colonized(specification) -- xetex mode list = { } lpeg.match(pattern,specification.specification) + set_default_features(list.script) if list.style then specification.style = list.style list.style = nil |