summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-01-26 14:16:17 +0100
committerPhilipp Gesang <phg42.2a@gmail.com>2014-01-26 14:16:17 +0100
commitc56e6b5862ec6e27f25bb00ffeba4ee4aa3ccf61 (patch)
tree60b0a90dda9679e1a7b496c5bd1e1bff48c34b36
parent0380abcae75cccdc394c4da1fbfe838e876e53cc (diff)
downloadluaotfload-c56e6b5862ec6e27f25bb00ffeba4ee4aa3ccf61.tar.gz
[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.
-rw-r--r--luaotfload-database.lua30
1 files 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