From 1354f05f0ff1ca157d2976721b29341ba1c4598a Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 3 Jun 2016 08:19:24 +0200 Subject: [aux] remove double scaling of capheight from typoascender Fix #358 The typographic ascender value from the metrics (Windows metrics) table comes prescaled by the fontloader but we scaled it nevertheless. This is not true, however, for the value in the metrics table. Fix the access method to treat the values differently. --- src/luaotfload-auxiliary.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/luaotfload-auxiliary.lua b/src/luaotfload-auxiliary.lua index e482aba..3c43eb9 100644 --- a/src/luaotfload-auxiliary.lua +++ b/src/luaotfload-auxiliary.lua @@ -212,15 +212,19 @@ end local query_ascender = function (fontdata) local parameters = fontdata.parameters if not parameters then return false end + local ascender = parameters.ascender + if ascender then + return ascender --- pre-scaled + end + local shared = fontdata.shared if not shared then return false end local rawdata = shared.rawdata if not rawdata then return false end local metadata = rawdata.metadata if not metadata then return false end - local ascender = parameters.ascender - or metadata.ascender if not ascender then return false end + ascender = metadata.ascender if not ascender then return false end local size = parameters.size if not size then return false end local units = lookup_units (fontdata) if not units or units == 0 then return false end - return ascender * size / units + return ascender * size / units --- scaled end local query_capheight = function (fontdata) -- cgit v1.2.3