diff options
author | Philipp Gesang <phg@phi-gamma.net> | 2016-06-03 08:19:24 +0200 |
---|---|---|
committer | Philipp Gesang <phg@phi-gamma.net> | 2016-06-03 08:19:27 +0200 |
commit | 1354f05f0ff1ca157d2976721b29341ba1c4598a (patch) | |
tree | e62f999be13d086f00e7b9c88e57f45f2fed3dd8 /src/luaotfload-auxiliary.lua | |
parent | 9bc8a2425b2608b8a93e91042191421ad81dc956 (diff) | |
download | luaotfload-1354f05f0ff1ca157d2976721b29341ba1c4598a.tar.gz |
[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.
Diffstat (limited to 'src/luaotfload-auxiliary.lua')
-rw-r--r-- | src/luaotfload-auxiliary.lua | 10 |
1 files changed, 7 insertions, 3 deletions
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) |