FontFaceTextMeasurer Class
Measures text by shaping it with a font of Meziantou.Framework.Fonts: every script, ligatures, kerning and the advances of the font are taken into account.
public sealed class FontFaceTextMeasurer : ITextMeasurerRemarks
The text is split into runs of one script; each run is shaped in the direction of its first strong character.
- Implements
Constructors
| Name | Description |
|---|---|
| FontFaceTextMeasurer(FontFace, FontFace?, string?) | Initializes a new instance of the FontFaceTextMeasurer class. |
FontFaceTextMeasurer(FontFace, FontFace?, string?)
FontFaceTextMeasurer.csInitializes a new instance of the FontFaceTextMeasurer class.
Parameters
regularFontFace- The face of the regular text, loaded with
FontLoader. boldFontFace?- The face of the bold text, or
nullto measure bold text withregular. fontFamilystring?- The CSS
font-familyof the text, ornullfor the family name ofregular.
Properties
| Name | Description |
|---|---|
| FontFamily | Gets the font family the measured text is drawn with, as a CSS font-family value. |
FontFamily
FontFaceTextMeasurer.csMethods
| Name | Description |
|---|---|
| Measure(string, ChartFont) | Measures a line of text. |
Measure(string, ChartFont)
FontFaceTextMeasurer.csMeasures a line of text.
public TextMetrics Measure(string text, ChartFont font)