getAdvanceWidth method

double getAdvanceWidth(
  1. int glyphId,
  2. double fontSize
)

Advance width for glyphId scaled to fontSize in pixels.

Returns 0 if glyphId is out of range.

Implementation

double getAdvanceWidth(int glyphId, double fontSize) {
  if (glyphId < 0 || glyphId >= _hmtx.length) return 0;
  return _hmtx[glyphId].advanceWidth * fontSize / metrics.unitsPerEm;
}