summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2016-04-27 08:20:15 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2016-04-27 08:20:17 +0200
commit48a7f10116bcdbcfbf427e761c48df33713ba5e5 (patch)
treed031f9a27baf9ced338f5af9f4e8071030a99c3f
parent08f6c022be4fca298df03fe5582647d5b8c9785e (diff)
downloadluaotfload-48a7f10116bcdbcfbf427e761c48df33713ba5e5.tar.gz
[db] disarm fallback assignment
When adapting to the new loader we repeated the mistake of classifying “bold” faces by too broad criteria, thereby sabotaging the recognition of large families from Adobe. Restore the old behavior by only treating those faces as bold fallback that advertise and exact weight of 700.
-rw-r--r--src/luaotfload-database.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua
index e0f6e61..0c2fd40 100644
--- a/src/luaotfload-database.lua
+++ b/src/luaotfload-database.lua
@@ -478,7 +478,6 @@ end
--- define locals in scope
local access_font_index
-local collect_families
local find_closest
local flush_lookup_cache
local generate_filedata
@@ -2567,6 +2566,9 @@ generate_filedata = function (mappings)
return files
end
+local bold_spectrum_low = 501 --- 500 is medium, 900 heavy/black
+local bold_weight = 700
+
local pick_style
local pick_fallback_style
local check_regular
@@ -2607,7 +2609,7 @@ do
pick_fallback_style = function (italicangle, weight, pfmweight)
--- more aggressive, but only to determine bold faces
- if pfmweight > 500 or bold_synonym [weight] then --- bold spectrum matches
+ if pfmweight == bold_weight or bold_synonym [weight] then --- bold spectrum matches
if italicangle == 0 then
return "b"
end
@@ -2713,7 +2715,7 @@ local get_subtable = function (families, entry)
return subtable
end
-collect_families = function (mappings)
+local collect_families = function (mappings)
logreport ("info", 2, "db", "Analyzing families.")
@@ -2753,7 +2755,7 @@ collect_families = function (mappings)
if modifier then
add_family (familyname, subtable, modifier, entry)
- elseif pfmweight > 500 then -- in bold spectrum
+ elseif pfmweight >= bold_spectrum_low then -- in bold spectrum
modifier = pick_fallback_style (italicangle, weight, pfmweight)
if modifier then
add_family (familyname, subtable, modifier, entry)
@@ -2776,8 +2778,6 @@ end
--doc]]--
-local bold_spectrum_low = 501 --- 500 is medium, 900 heavy/black
-local bold_weight = 700
local style_categories = { "r", "b", "i", "bi" }
local bold_categories = { "b", "bi" }