PdfCanvasFont Class

Definition

A font of a document that a PdfCanvas shows text with: how text encodes in it, how wide it is, and its vertical metrics. Get one with GetStandard14Font(Standard14Font) or EmbedTrueTypeFont(ReadOnlyMemory<Byte>, Int32).

public abstract class PdfCanvasFont

Remarks

ISO 32000-2 §9.2.4 (glyph positioning and metrics: widths in thousandths of text space), §9.3 (text state) and §9.4.3 (text space displacement). A canvas font owns one font dictionary of its document (Font is the read view over it); the canvas names it in the Font resources and writes each character of shown text as the font's character code.

Metrics are in glyph space units, thousandths of text space: multiply by the font size and divide by 1000 for text space units. MeasureWidth(ReadOnlySpan<Char>, Double, Boolean) gives the advance of text without character spacing, word spacing or horizontal scaling, which the canvas's text state adds when the text is shown (§9.4.4: tx = ((w0 − Tj/1000) × Tfs + Tc + Tw) × Th).

Tip: use kind:method, kind:property, kind:ctor. Press Esc to clear.

Properties (8)

Methods (5)