From 0380abcae75cccdc394c4da1fbfe838e876e53cc Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 26 Jan 2014 13:52:55 +0100 Subject: [tests] include new parsers file --- mktests | 1 + 1 file changed, 1 insertion(+) diff --git a/mktests b/mktests index baa710c..817fbf6 100755 --- a/mktests +++ b/mktests @@ -31,6 +31,7 @@ kpse.set_program_name "luatex" require "lualibs" require "luaotfload-basics-gen.lua" require "luaotfload-override.lua" +require "luaotfload-parsers" require "luaotfload-database" local names = fonts.names -- cgit v1.2.3 From c56e6b5862ec6e27f25bb00ffeba4ee4aa3ccf61 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 26 Jan 2014 14:16:17 +0100 Subject: [db] test numeric weight only under certain circumstances Else DejaVu Sans picks the condensed shape for bold because all fonts in the bundle claim to be part of the same font family, without differentiating by setting a meta family. --- luaotfload-database.lua | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/luaotfload-database.lua b/luaotfload-database.lua index 28109ec..c979acf 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -2455,23 +2455,19 @@ do local b = false if italic_synonym [field] then - i = true + return "i" end - if weight == 700 or field == "bold" then - b = true + if field == "bold" then + return "b" end if field == "bolditalic" or field == "boldoblique" then - b = true - i = true + return "bi" end - if i and b then - return "bi" - elseif i then - return "i" - elseif b then + if weight == 700 then + --- matches only if weight is specified return "b" end @@ -2485,11 +2481,11 @@ do weight) local style if fontstyle_name then - style = choose_exact (fontstyle_name, weight) + style = choose_exact (fontstyle_name --[[ , weight ]]) end if not style then if prefmodifiers then - style = choose_exact (prefmodifiers, weight) + style = choose_exact (prefmodifiers --[[ , weight ]]) elseif subfamily then style = choose_exact (subfamily, weight) end @@ -2506,7 +2502,9 @@ do check_regular = function (fontstyle_name, prefmodifiers, subfamily, - splitstyle) + splitstyle, + italicangle, + weight) if fontstyle_name then return regular_synonym [fontstyle_name] @@ -2516,6 +2514,8 @@ do return regular_synonym [subfamily] elseif splitstyle then return regular_synonym [splitstyle] + elseif italicangle == 0 and weight == 400 then + return true end return nil @@ -2644,7 +2644,9 @@ local collect_families = function (mappings) modifier = check_regular (fontstyle_name, prefmodifiers, subfamily, - splitstyle) + splitstyle, + italicangle, + weight) end if modifier then -- cgit v1.2.3 From a52e157de5a969b7d80af1c8621a7d7b031b572f Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 26 Jan 2014 14:19:09 +0100 Subject: [tests] adapt file names --- mktests | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mktests b/mktests index 817fbf6..3a55b8d 100755 --- a/mktests +++ b/mktests @@ -87,11 +87,11 @@ local infer_regular_style = { { "Garamond Premier Pro", "GaramondPremrPro.otf" }, { "CMU Serif", "cmunrm.otf" }, { "CMU Sans Serif", "cmunss.otf" }, - { "Minion Pro", "MinionPro_Regular.otf" }, + { "Minion Pro", "MinionPro-Regular.otf" }, --- Below test will succeed only if we match for the --- splainname (= sanitized tfmdata.fullname) field --- explicitly. - { "Minion Pro Italic", "MinionPro_It.otf" }, + { "Minion Pro Italic", "MinionPro-It.otf" }, } local choose_optical_size = { @@ -141,10 +141,10 @@ local choose_style = { Also, the full Minion Pro set comes with different optical sizes which for monetary reasons cannot considered here. --]]-- - { { name = "Minion Pro", style = "regular" }, "MinionPro_Regular.otf" }, - { { name = "Minion Pro", style = "italic" }, "MinionPro_It.otf" }, - { { name = "Minion Pro", style = "bold" }, "MinionPro_Bold.otf" }, - { { name = "Minion Pro", style = "bolditalic" }, "MinionPro_BoldIt.otf" }, + { { name = "Minion Pro", style = "regular" }, "MinionPro-Regular.otf" }, + { { name = "Minion Pro", style = "italic" }, "MinionPro-It.otf" }, + { { name = "Minion Pro", style = "bold" }, "MinionPro-Bold.otf" }, + { { name = "Minion Pro", style = "bolditalic" }, "MinionPro-BoldIt.otf" }, } --- this needs a database built with --formats=+pfa,pfb,afm -- cgit v1.2.3