widthOf method
Width of code code in thousandths of an em.
Implementation
double widthOf(int code) {
if (composite) {
return cidWidths[code] ?? defaultWidth;
}
final index = code - firstChar;
if (index >= 0 && index < widths.length) {
final value = widths[index];
// A zero in `/Widths` is usually a hole in the subset, not a glyph
// with no advance; in that case the fallback is the better guess.
if (value != 0) return value;
}
if (widths.isEmpty) return missingWidth ?? defaultWidth;
return missingWidth ?? 0;
}