Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Commit

Permalink
[aux] remove double scaling of capheight from typoascender
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
phi-gamma committed Jun 3, 2016
1 parent 9bc8a24 commit 1354f05
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/luaotfload-auxiliary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1354f05

Please sign in to comment.