summaryrefslogtreecommitdiff
path: root/luaotfload-database.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2013-06-22 16:16:21 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2013-06-22 16:16:21 +0200
commitbd0a8039e89b9403b58ac5a9827a333276a6fbf6 (patch)
tree8e8cc079a4b9b235df95344a30873de969f497fa /luaotfload-database.lua
parent5fa488d55de0b89708e6028491fffa5f43ca279d (diff)
downloadluaotfload-bd0a8039e89b9403b58ac5a9827a333276a6fbf6.tar.gz
treat *medium* as a synonym for *bold*
treating *medium* as *regular* weight leads to incorrect matches with Garamond Premier and likely other fonts as well. apparently, this also happened with other typographical programs, e. g. http://blogs.adobe.com/typblography/2008/05/indesign_font_conflicts.html note: the matching algorithm could be rewritten so as to resolve names in two passes: 1. collect a list of candidates. if there is a literal match, pick that one 2. test style synonyms against the candidates according to a precedence list so that “regular” always precedes “medium” to take this thought a bit further, the synonyms could also be ordered by weight according to some assumptions. then we could pick the closest weight present in the database. example: suppose *regular* is assigned a weight index of 3, *medium* gets *4* (i. e. just a tad heavier), and *bold* 7. then the synonym regular would be preferred for the request *regular* if present, but medium would be chosen over bold if there is no *regular* shape. this would probably be overkill, though.
Diffstat (limited to 'luaotfload-database.lua')
-rw-r--r--luaotfload-database.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/luaotfload-database.lua b/luaotfload-database.lua
index 41adf88..4c45d21 100644
--- a/luaotfload-database.lua
+++ b/luaotfload-database.lua
@@ -326,12 +326,14 @@ end
local style_synonyms = { set = { } }
do
+ --- read this: http://blogs.adobe.com/typblography/2008/05/indesign_font_conflicts.html
+ --- tl;dr: font style synonyms are unreliable.
style_synonyms.list = {
- regular = { "normal", "roman",
- "plain", "book",
- "medium", },
+ regular = { "normal", "roman",
+ "plain", "book", },
bold = { "demi", "demibold",
- "semibold", "boldregular",},
+ "semibold", "boldregular",
+ "medium" },
italic = { "regularitalic", "normalitalic",
"oblique", "slanted", },
bolditalic = { "boldoblique", "boldslanted",