From 3abd68b25bf2c12371df046c0a5ff035bcd20d11 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Wed, 10 Jul 2013 14:00:32 +0200 Subject: prioritize ``prefmodifiers`` oer ``subfamily`` follow-up to these previous modifications: * https://github.com/phi-gamma/luaotfload/commit/fcdbafd0c86fdba08 * https://github.com/phi-gamma/luaotfload/commit/2938e7d63404f1d2e * https://github.com/phi-gamma/luaotfload/commit/0e51cff12b24d264b addresses https://github.com/lualatex/luaotfload/issues/108 i.e. "name:DejaVu Serif" does not resolve to the Condensed face anymore. --- luaotfload-database.lua | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/luaotfload-database.lua b/luaotfload-database.lua index f939e83..7215e11 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -799,7 +799,7 @@ resolve = function (_, _, specification) -- the 1st two parameters are used by C if facenames then family = facenames.family subfamily = facenames.subfamily - prefmodifiers = facenames.prefmodifiers + prefmodifiers = facenames.prefmodifiers or facenames.subfamily fullname = facenames.fullname psname = facenames.psname fontname = facenames.fontname @@ -818,16 +818,19 @@ resolve = function (_, _, specification) -- the 1st two parameters are used by C if continue == false then break end elseif style == subfamily then exact = add_to_match(exact, askedsize, face) + elseif synonym_set[style] and synonym_set[style][prefmodifiers] + or synonym_set.regular[prefmodifiers] + then + --- treat synonyms for prefmodifiers as first-class + --- (needed to prioritize DejaVu Book over Condensed) + exact = add_to_match(exact, askedsize, face) elseif name == fullname or name == pfullname or name == fontname or name == psname then - synonymous, continue = add_to_match(synonymous, askedsize, face) - elseif synonym_set[style] and - (synonym_set[style][prefmodifiers] or - synonym_set[style][subfamily]) - or synonym_set.regular[prefmodifiers] + synonymous = add_to_match(synonymous, askedsize, face) + elseif synonym_set[style] and synonym_set[style][subfamily] or synonym_set.regular[subfamily] then synonymous = add_to_match(synonymous, askedsize, face) -- cgit v1.2.3