metricsForChar function
dynamic
metricsForChar(
- dynamic font,
- dynamic chars,
- dynamic notFoundMetrics
Implementation
function metricsForChar(font, chars, notFoundMetrics) {
for (let i = 0; i < chars.length; i += 1) {
const glyphIndex = font.charToGlyphIndex(chars[i]);
if (glyphIndex > 0) {
const glyph = font.glyphs.get(glyphIndex);
return glyph.getMetrics();
}
}
return notFoundMetrics;
}