summaryrefslogtreecommitdiff
path: root/luaotfload-database.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-07-10 14:00:32 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-07-10 14:00:32 +0200
commit3abd68b25bf2c12371df046c0a5ff035bcd20d11 (patch)
tree5f67c6242282608d96602c78de76471aaafa5e7d /luaotfload-database.lua
parent021f0c5e4859e15dc1d24cd232a327fd69446cb1 (diff)
downloadluaotfload-3abd68b25bf2c12371df046c0a5ff035bcd20d11.tar.gz
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.
Diffstat (limited to 'luaotfload-database.lua')
-rw-r--r--luaotfload-database.lua15
1 files 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)