Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Commit

Permalink
[db] tentatively reintroduce fallback for italic
Browse files Browse the repository at this point in the history
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
  • Loading branch information
phi-gamma committed Oct 19, 2016
1 parent 394dea7 commit aad2486
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/luaotfload-database.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit aad2486

Please sign in to comment.