ITextMeasurer Interface
Measures text, so the layout of a chart or a diagram (margins, label rotation, truncation, wrapping) fits the font that draws it.
public interface ITextMeasurerProperties
| Name | Description |
|---|---|
| FontFamily | Gets the font family the measured text is drawn with, as a CSS font-family value. |
| Fonts | Gets the fonts the text is measured with, or null when the measurer does not have font files (for instance, the metrics of AfmTextMeasurer). A chart or a diagram sets them as the fonts of its scene (Scene.Fonts), so the renderers draw the text with the fonts that measured it. |
FontFamily
Fonts
ITextMeasurer.csGets the fonts the text is measured with, or null when the measurer does not have font files (for instance, the metrics of AfmTextMeasurer). A chart or a diagram sets them as the fonts of its scene (Scene.Fonts), so the renderers draw the text with the fonts that measured it.
public SceneFontCollection? Fonts { get; }Property value
Methods
| Name | Description |
|---|---|
| Measure(string, SceneFont) | Measures a line of text. |
| Measure(string, SceneFont, double, double) | Measures a line of text with a letter spacing and a word spacing (SceneText.LetterSpacing, SceneText.WordSpacing), as the renderers draw it. |
Measure overloads
Measure(string, SceneFont)
Measures a line of text.
TextMetrics Measure(string text, SceneFont font)Measure(string, SceneFont, double, double)
ITextMeasurer.csMeasures a line of text with a letter spacing and a word spacing (SceneText.LetterSpacing, SceneText.WordSpacing), as the renderers draw it.
public TextMetrics Measure(string text, SceneFont font, double letterSpacing, double wordSpacing)Parameters
textstring- The text, on one line.
fontSceneFont- The size, the weight and the style of the font.
letterSpacingdouble- The space added after each character, in pixels.
wordSpacingdouble- The space added after each space (U+0020 and U+00A0), in pixels.
Returns
TextMetrics The dimensions of the text: its width includes the spacing.
Remarks
The default implementation adds the spacing after each grapheme cluster to ITextMeasurer.Measure. The measurers that shape the text measure it as the renderers draw it with a letter spacing: without the optional ligatures, and with the spacing after each cluster of glyphs.