From 48a7f10116bcdbcfbf427e761c48df33713ba5e5 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Wed, 27 Apr 2016 08:20:15 +0200 Subject: [db] disarm fallback assignment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/luaotfload-database.lua | 12 ++++++------ 1 file 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" } -- cgit v1.2.3