Interface ITextMeasurer
Measures text advance widths and line heights from font metrics.
Implement this interface to substitute an alternative font measurement backend
(e.g. SkiaSharp, System.Drawing) without affecting the layout engine.
Assembly: DRIT.Document.dll
Syntax
public interface ITextMeasurer
Methods
Ascent(string, double, bool, bool)
Returns the font ascent in points (distance from baseline to top of em-square).
Declaration
double Ascent(string fontName, double sizePt, bool bold, bool italic)
Parameters
Returns
LineHeight(string, double, bool, bool)
Returns the natural line height in points (ascender − descender + line gap)
for the given font settings.
Declaration
double LineHeight(string fontName, double sizePt, bool bold, bool italic)
Parameters
Returns
MeasureWidth(string, string, double, bool, bool)
Returns the total advance width of text in points
at the given font settings.
Returns a positive value, or 0 when text is empty.
Declaration
double MeasureWidth(string text, string fontName, double sizePt, bool bold, bool italic)
Parameters
Returns
StrikeoutOffsetPt(string, double, bool, bool)
Returns the strikeout stroke offset from the baseline in points.
Negative values are above the baseline (the typical case).
Declaration
double StrikeoutOffsetPt(string fontName, double sizePt, bool bold, bool italic)
Parameters
Returns
StrikeoutThicknessPt(string, double, bool, bool)
Returns the strikeout stroke thickness in points.
Declaration
double StrikeoutThicknessPt(string fontName, double sizePt, bool bold, bool italic)
Parameters
Returns
UnderlineOffsetPt(string, double, bool, bool)
Returns the underline stroke offset from the baseline in points.
Positive values are below the baseline (the typical case).
Declaration
double UnderlineOffsetPt(string fontName, double sizePt, bool bold, bool italic)
Parameters
Returns
UnderlineThicknessPt(string, double, bool, bool)
Returns the underline stroke thickness in points.
Declaration
double UnderlineThicknessPt(string fontName, double sizePt, bool bold, bool italic)
Parameters
Returns