diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2016-10-19 23:44:53 +0200 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2016-10-19 23:44:56 +0200 |
commit | aad248616a9e02c8684876d4ba61500930e7fceb (patch) | |
tree | 8a23150bc81598e545b851592c47e3c00e50b50d | |
parent | 394dea756716ecea5b764dffc8b10c2de0c3a15c (diff) | |
download | luaotfload-aad248616a9e02c8684876d4ba61500930e7fceb.tar.gz |
[db] tentatively reintroduce fallback for italic
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
-rw-r--r-- | src/luaotfload-database.lua | 18 |
1 files 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 |