From aad248616a9e02c8684876d4ba61500930e7fceb Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Wed, 19 Oct 2016 23:44:53 +0200 Subject: [db] tentatively reintroduce fallback for italic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix assignment of LM series fonts. Currently these are broken because of borked typosub identifiers like “8oblique” that prevent exact name matching and at the same time exclude matching the (usable) subfamily. Introduce a heuristic based on the italic angle value that assigns italic as a fallback in these cases. Test: https://bitbucket.org/phg/lua-la-tex-tests/src/857c83ca98cb35153979a0613d3a742bfd93f834/lua/tla-names-3-lm.lua --- src/luaotfload-database.lua | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua index f6ea03e..c6ccaa6 100644 --- a/src/luaotfload-database.lua +++ b/src/luaotfload-database.lua @@ -1511,7 +1511,6 @@ end local organize_styledata = function (metadata, rawinfo, info) local pfminfo = metadata.pfminfo local names = rawinfo.names - return { --- see http://www.microsoft.com/typography/OTSPEC/features_pt.htm#size size = get_size_info (rawinfo), @@ -2553,6 +2552,7 @@ generate_filedata = function (mappings) end local bold_spectrum_low = 501 --- 500 is medium, 900 heavy/black +local normal_weight = 400 local bold_weight = 700 local normal_width = 5 @@ -2606,12 +2606,18 @@ do treating weights > 500 as bold or allowing synonyms like “heavy”, “black”. --]]-- - if width == normal_width and pfmweight == bold_weight then - --- bold spectrum matches - if italicangle == 0 then - return "b" + if width == normal_width then + if pfmweight == bold_weight then + --- bold spectrum matches + if italicangle == 0 then + return "b" + end + return "bi" + elseif pfmweight == normal_weight then + if italicangle ~= 0 then + return "i" + end end - return "bi" end return false end -- cgit v1.2.3