From c56e6b5862ec6e27f25bb00ffeba4ee4aa3ccf61 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 26 Jan 2014 14:16:17 +0100 Subject: [db] test numeric weight only under certain circumstances Else DejaVu Sans picks the condensed shape for bold because all fonts in the bundle claim to be part of the same font family, without differentiating by setting a meta family. --- luaotfload-database.lua | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/luaotfload-database.lua b/luaotfload-database.lua index 28109ec..c979acf 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -2455,23 +2455,19 @@ do local b = false if italic_synonym [field] then - i = true + return "i" end - if weight == 700 or field == "bold" then - b = true + if field == "bold" then + return "b" end if field == "bolditalic" or field == "boldoblique" then - b = true - i = true + return "bi" end - if i and b then - return "bi" - elseif i then - return "i" - elseif b then + if weight == 700 then + --- matches only if weight is specified return "b" end @@ -2485,11 +2481,11 @@ do weight) local style if fontstyle_name then - style = choose_exact (fontstyle_name, weight) + style = choose_exact (fontstyle_name --[[ , weight ]]) end if not style then if prefmodifiers then - style = choose_exact (prefmodifiers, weight) + style = choose_exact (prefmodifiers --[[ , weight ]]) elseif subfamily then style = choose_exact (subfamily, weight) end @@ -2506,7 +2502,9 @@ do check_regular = function (fontstyle_name, prefmodifiers, subfamily, - splitstyle) + splitstyle, + italicangle, + weight) if fontstyle_name then return regular_synonym [fontstyle_name] @@ -2516,6 +2514,8 @@ do return regular_synonym [subfamily] elseif splitstyle then return regular_synonym [splitstyle] + elseif italicangle == 0 and weight == 400 then + return true end return nil @@ -2644,7 +2644,9 @@ local collect_families = function (mappings) modifier = check_regular (fontstyle_name, prefmodifiers, subfamily, - splitstyle) + splitstyle, + italicangle, + weight) end if modifier then -- cgit v1.2.3