PeachDrawing.Text
PeachDrawing.Text.Typeface
Typeface.TryGetGridFittedAdvance(ushort, OutlineRequest, double) Method
The advance of a glyph in pixels after grid-fitting at a size: a whole number of pixels, as the font’s hinting leaves it. It is what GridFittedAdvance gives too, and also answers for a glyph with no ink, which has no outline.
public bool TryGetGridFittedAdvance(ushort glyph, in PeachDrawing.Text.Outlines.OutlineRequest request, out double advance);
Parameters
glyph System.UInt16
The glyph.
request OutlineRequest
The size and the kind of grid-fitting; None has no fitted advance.
advance System.Double
The advance in pixels.
Returns
System.Boolean
false when GridFitting is None, or the glyph cannot be grid-fitted.
Exceptions
System.ArgumentOutOfRangeException
GridFitting is not a defined value, or is not None and PixelsPerEm is not a positive number.