parseHmtxTableAll function
dynamic
parseHmtxTableAll(
- dynamic data,
- dynamic start,
- dynamic numMetrics,
- dynamic numGlyphs,
- dynamic glyphs,
Implementation
parseHmtxTableAll(data, start, numMetrics, numGlyphs, glyphs) {
var advanceWidth;
var leftSideBearing;
var p = new Parser(data, start);
for (var i = 0; i < numGlyphs; i += 1) {
// If the font is monospaced, only one entry is needed. This last entry applies to all subsequent glyphs.
if (i < numMetrics) {
advanceWidth = p.parseUShort();
leftSideBearing = p.parseShort();
}
var glyph = glyphs.get(i);
glyph.advanceWidth = advanceWidth;
glyph.leftSideBearing = leftSideBearing;
}
}