We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e0b5cd8 commit 2b109a0Copy full SHA for 2b109a0
1 file changed
shapers/base.lua
@@ -67,9 +67,18 @@ function shaper:measureChar (char)
67
local options = SILE.font.loadDefaults({})
68
options.tracking = SILE.settings:get("shaper.tracking")
69
local items = self:shapeToken(char, options)
70
- if items and items[1] then
71
- local item = items[1]
72
- return item, item.gid ~= 0
+ if items and #items > 0 then
+ local measurements = {
+ width = 0,
73
+ height = 0,
74
+ depth = 0,
75
+ }
76
+ for _, item in ipairs(items) do
77
+ measurements.width = measurements.width + item.width
78
+ measurements.height = math.max(measurements.height, item.height)
79
+ measurements.depth = math.max(measurements.depth, item.depth)
80
+ end
81
+ return measurements, items[1].gid ~= 0
82
else
83
SU.error("Unable to measure character", char)
84
end
0 commit comments