AfmTextMeasurer Class
Measures text with the metrics of Helvetica and Helvetica-Bold, the standard fonts of PDF, without any font file or system font: the measurement is the same on every machine.
public sealed class AfmTextMeasurer : ITextMeasurerRemarks
The characters are mapped to the glyphs of the font through the Adobe Glyph List, and the kerning pairs of the font are applied. The text is measured by grapheme cluster: a character the font lacks counts as 1 em when it is wide (East Asian width Wide or Fullwidth, such as CJK ideographs and most emoji), as nothing when it is a combining mark, and as the average width of the font otherwise.
Arial and Liberation Sans have the same widths as Helvetica, so the text the SVG draws with Helvetica, Arial, sans-serif fits the layout.
- Implements
Properties
| Name | Description |
|---|---|
| Default | Gets the measurer. It is thread-safe. |
| FontFamily | Gets Helvetica, Arial, sans-serif. |
Default
AfmTextMeasurer.csFontFamily
AfmTextMeasurer.csMethods
| Name | Description |
|---|---|
| Measure(string, ChartFont) | Measures a line of text. |
Measure(string, ChartFont)
AfmTextMeasurer.csMeasures a line of text.
public TextMetrics Measure(string text, ChartFont font)