From 4dd4ee4df065d2681486259bf59dbac8136ead53 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Wed, 28 Aug 2013 10:25:45 +0200 Subject: [tests] check resolving of styles --- mktests | 48 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/mktests b/mktests index 50402cc..cf53626 100755 --- a/mktests +++ b/mktests @@ -78,30 +78,51 @@ local infer_regular_style = { { "DejaVu Sans", "DejaVuSans.ttf" }, { "Adobe Garamond Pro", "agaramondpro_regular.otf" }, { "Garamond Premier Pro", "GaramondPremrPro-Capt.otf" }, + { "CMU Serif", "cmunrm.otf" }, + { "CMU Sans Serif", "cmunss.otf" }, } local choose_optical_size = { - { { name = "Latin Modern Roman", optsize = 0 }, "lmroman5-regular.otf" }, - { { name = "Latin Modern Roman", optsize = 10 }, "lmroman10-regular.otf" }, - { { name = "Latin Modern Roman", optsize = 12 }, "lmroman12-regular.otf" }, - { { name = "Latin Modern Roman", optsize = 42 }, "lmroman17-regular.otf" }, - { { name = "EB Garamond", optsize = 0 }, "EBGaramond08-Regular.otf" }, - { { name = "EB Garamond", optsize = 8 }, "EBGaramond08-Regular.otf" }, - { { name = "EB Garamond", optsize = 12 }, "EBGaramond12-Regular.otf" }, - { { name = "EB Garamond", optsize = 42 }, "EBGaramond12-Regular.otf" }, + { { name = "Latin Modern Roman", optsize = 0 }, "lmroman5-regular.otf" }, + { { name = "Latin Modern Roman", optsize = 10 }, "lmroman10-regular.otf" }, + { { name = "Latin Modern Roman", optsize = 12 }, "lmroman12-regular.otf" }, + { { name = "Latin Modern Roman", optsize = 42 }, "lmroman17-regular.otf" }, + { { name = "EB Garamond", optsize = 0 }, "EBGaramond08-Regular.otf" }, + { { name = "EB Garamond", optsize = 8 }, "EBGaramond08-Regular.otf" }, + { { name = "EB Garamond", optsize = 12 }, "EBGaramond12-Regular.otf" }, + { { name = "EB Garamond", optsize = 42 }, "EBGaramond12-Regular.otf" }, { { name = "Garamond Premier Pro", optsize = 0 }, "GaramondPremrPro-Capt.otf" }, - { { name = "Garamond Premier Pro", optsize = 10 }, "GaramondPremrPro.otf" }, + { { name = "Garamond Premier Pro", optsize = 10 }, "GaramondPremrPro.otf" }, { { name = "Garamond Premier Pro", optsize = 15 }, "GaramondPremrPro-Subh.otf" }, { { name = "Garamond Premier Pro", optsize = 42 }, "GaramondPremrPro-Disp.otf" }, } +local choose_style = { + { { name = "DejaVu Sans", style = "regular" }, "DejaVuSans.ttf" }, + { { name = "DejaVu Sans", style = "italic" }, "DejaVuSans-Oblique.ttf" }, + { { name = "DejaVu Sans", style = "bold" }, "DejaVuSans-Bold.ttf" }, + { { name = "DejaVu Sans", style = "bolditalic" }, "DejaVuSans-BoldOblique.ttf" }, + { { name = "Linux Libertine O", style = "regular" }, "LinLibertine_R.otf" }, + { { name = "Linux Libertine O", style = "italic" }, "LinLibertine_RI.otf" }, + { { name = "Linux Libertine O", style = "bold" }, "LinLibertine_RB.otf" }, + { { name = "Linux Libertine O", style = "bolditalic" }, "LinLibertine_RBI.otf" }, + { { name = "Liberation Serif", style = "regular" }, "LiberationSerif-Regular.ttf" }, + { { name = "Liberation Serif", style = "italic" }, "LiberationSerif-Italic.ttf" }, + { { name = "Liberation Serif", style = "bold" }, "LiberationSerif-Bold.ttf" }, + { { name = "Liberation Serif", style = "bolditalic" }, "LiberationSerif-BoldItalic.ttf" }, + { { name = "CMU Sans Serif", style = "regular" }, "cmunss.otf" }, -- no “regular” but “medium” + { { name = "CMU Sans Serif", style = "italic" }, "cmunsi.otf" }, -- no “italic” but “oblique” + { { name = "CMU Sans Serif", style = "bold" }, "cmunsx.otf" }, + { { name = "CMU Sans Serif", style = "bolditalic" }, "cmunso.otf" }, +} + --- this needs a database built with --formats=+pfa,pfb,afm local resolve_t1_font = { - { { name = "URW Gothic L", style = "regular" }, "uagk8a.pfb" }, - { { name = "URW Gothic L", style = "italic" }, "uagko8a.pfb" }, - { { name = "URW Gothic L", style = "bold" }, "uagd8a.pfb" }, - { { name = "URW Gothic L", style = "bolditalic" }, "uagdo8a.pfb" }, + { { name = "URW Gothic L", style = "regular" }, "uagk8a.pfb" }, + { { name = "URW Gothic L", style = "italic" }, "uagko8a.pfb" }, + { { name = "URW Gothic L", style = "bold" }, "uagd8a.pfb" }, + { { name = "URW Gothic L", style = "bolditalic" }, "uagdo8a.pfb" }, { { name = "Century Schoolbook L", style = "regular" }, "uncr8a.pfb" }, { { name = "Century Schoolbook L", style = "italic" }, "uncri8a.pfb" }, { { name = "Century Schoolbook L", style = "bold" }, "uncb8a.pfb" }, @@ -115,6 +136,7 @@ local resolve_t1_font = { local font_name_tests = { infer_regular_style, choose_optical_size, + choose_style, resolve_t1_font, } -- cgit v1.2.3 From d37b2982fe11f4d476b6dbc4c33065682af3855b Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 31 Aug 2013 12:07:10 +0200 Subject: [letterspacing] do not skip first glyph if liga --- luaotfload-extralibs.lua | 9 ++++----- luaotfload-letterspace.lua | 4 +++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/luaotfload-extralibs.lua b/luaotfload-extralibs.lua index 3769e06..5444b30 100644 --- a/luaotfload-extralibs.lua +++ b/luaotfload-extralibs.lua @@ -369,11 +369,10 @@ kerns.disablecharacterkerning = disablecharacterkerning --- now for the simplistic variant --- unit -> bool local enablefontkerning = function ( ) - return add_processor( - kernfont.handler, - "typesetters.kernfont", - "pre_linebreak_filter", "hpack_filter" - ) + return add_processor( kernfont.handler + , "typesetters.kernfont" + , "pre_linebreak_filter" + , "hpack_filter") end --- unit -> bool diff --git a/luaotfload-letterspace.lua b/luaotfload-letterspace.lua index 3134f22..847f175 100644 --- a/luaotfload-letterspace.lua +++ b/luaotfload-letterspace.lua @@ -118,7 +118,9 @@ kerncharacters = function (head) goto nextnode elseif firstkern then firstkern = false - goto nextnode + if not start.components then + goto nextnode + end end end -- cgit v1.2.3 From 57ed66cba09408ce5520668cc75482ccda490ef8 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 31 Aug 2013 12:21:33 +0200 Subject: =?UTF-8?q?[extralibs]=20compensate=20for=20missing=20=E2=80=9Cres?= =?UTF-8?q?ources=E2=80=9D=20field?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- luaotfload-extralibs.lua | 7 ++++++- luaotfload-letterspace.lua | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/luaotfload-extralibs.lua b/luaotfload-extralibs.lua index 5444b30..d04ba5b 100644 --- a/luaotfload-extralibs.lua +++ b/luaotfload-extralibs.lua @@ -211,7 +211,12 @@ if not markdata then if k == true then return marks[currentfont()] else - local resources = identifiers[k].resources or { } + local resources = { } + + if identifiers[k] then + resources = identifiers[k].resources or { } + end + local marks = resources.marks or { } t[k] = marks return marks diff --git a/luaotfload-letterspace.lua b/luaotfload-letterspace.lua index 847f175..961b0c5 100644 --- a/luaotfload-letterspace.lua +++ b/luaotfload-letterspace.lua @@ -118,7 +118,8 @@ kerncharacters = function (head) goto nextnode elseif firstkern then firstkern = false - if not start.components then + if (id ~= disc_code) and (not start.components) then + --- not a ligature, skip node goto nextnode end end -- cgit v1.2.3 From 9aec66e141e10d698e255c1303063e3a1236c278 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 31 Aug 2013 12:45:15 +0200 Subject: [letterspacing] skip redundant kerning of ligatures --- luaotfload-letterspace.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/luaotfload-letterspace.lua b/luaotfload-letterspace.lua index 961b0c5..b8bd36d 100644 --- a/luaotfload-letterspace.lua +++ b/luaotfload-letterspace.lua @@ -136,11 +136,12 @@ kerncharacters = function (head) --- 2) resolve ligatures local c = start.components + if c then if keepligature and keepligature(start) then -- keep 'm else - c = kerncharacters (c) + --- c = kerncharacters (c) --> taken care of after replacing local s = start local p, n = s.prev, s.next local tail = find_node_tail(c) -- cgit v1.2.3