diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2013-06-23 22:23:12 +0200 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2013-06-23 22:23:12 +0200 |
commit | 0e51cff12b24d264b8e17d8bd7f9a00763699963 (patch) | |
tree | 9a01d09d8e0fd9cb2f12754672b571390859ea06 | |
parent | baaeef6616db498218f6269fac7a6ec6fb185878 (diff) | |
download | luaotfload-0e51cff12b24d264b8e17d8bd7f9a00763699963.tar.gz |
treat subfamily match as exact, but not final match
-rw-r--r-- | luaotfload-database.lua | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/luaotfload-database.lua b/luaotfload-database.lua index 0903404..4554711 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -743,17 +743,15 @@ resolve = function (_, _, specification) -- the 1st two parameters are used by C fontname = fontname or sanitize_string(face.fontname) pfullname = pfullname or sanitize_string(face.fullname) - if name == family or name == metafamily then - if style == prefmodifiers then -- exact + if style == prefmodifiers then local continue exact, continue = add_to_match(exact, askedsize, face) if continue == false then break end - elseif prefmodifiers == "regular" then - --- TODO this match should be performed when building the db - fallback = face + elseif style == subfamily then + exact = add_to_match(exact, askedsize, face) elseif name == fullname or name == pfullname or name == fontname @@ -762,15 +760,16 @@ resolve = function (_, _, specification) -- the 1st two parameters are used by C local continue exact, continue = add_to_match(exact, askedsize, face) if continue == false then break end - elseif style == subfamily --- unreliable (see Ad. Garm. Pro) - or subfamily == "regular" - or synonym_set[style] and + elseif synonym_set[style] and (synonym_set[style][prefmodifiers] or synonym_set[style][subfamily]) or synonym_set.regular[prefmodifiers] or synonym_set.regular[subfamily] then synonymous = add_to_match(synonymous, askedsize, face) + elseif prefmodifiers == "regular" + or subfamily == "regular" then + fallback = face else --- mark as last straw but continue candidates[#candidates+1] = face end @@ -793,7 +792,6 @@ resolve = function (_, _, specification) -- the 1st two parameters are used by C found = synonymous end - --- this is a monster if #found == 1 then --- “found” is really synonymous with “registered in the db”. |