summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2016-04-26 08:15:07 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2016-04-26 08:15:07 +0200
commit73521a6f3d35b8cf0e4cfc5d57f32ee5b7d4d6d3 (patch)
treeec489743337cd1eee50e005269b732b3118d43ba
parent2a60462172f9e077e6df0887654a5e54fe4ce204 (diff)
downloadluaotfload-73521a6f3d35b8cf0e4cfc5d57f32ee5b7d4d6d3.tar.gz
[aux] actually pull capheight and ascender values from the correct table
-rw-r--r--src/luaotfload-auxiliary.lua19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/luaotfload-auxiliary.lua b/src/luaotfload-auxiliary.lua
index 06821f6..d6835a9 100644
--- a/src/luaotfload-auxiliary.lua
+++ b/src/luaotfload-auxiliary.lua
@@ -209,19 +209,24 @@ end
local query_ascender = function (fontdata)
local parameters = fontdata.parameters if not parameters then return false end
- local metadata = fontdata.metadata if not metadata then return false end
- local ascender = metadata.ascender if not ascender then return false 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
local units = metadata.units if units == 0 then return false end
local size = parameters.size if not size then return false end
return ascender * size / units
end
local query_capheight = function (fontdata)
- local parameters = fontdata.parameters if not parameters then return false end
- local metadata = fontdata.metadata if not metadata then return false end
- local capheight = metadata.capheight if not capheight then return false end
- local units = metadata.units if units == 0 then return false end
- local size = parameters.size if not size then return false end
+ local parameters = fontdata.parameters if not parameters then return false 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 capheight = metadata.capheight if not capheight then return false end
+ local units = metadata.units if units == 0 then return false end
+ local size = parameters.size if not size then return false end
return capheight * size / units
end