Table of Contents

Class GlyphOutlineReader

Namespace
DocWright.Fonts
Assembly
DocWright.Fonts.dll

Decodes glyph outlines from a font program. Outline access is deliberately separate from FontFace: a face carries metrics only, and the resolution cache holds many faces, so binding decoded outlines (or the font bytes they need) to a face would change the memory profile of every conversion. A caller that wants outlines supplies the program itself — the same font bytes a PDF embedder already loads — and decoding happens on demand.

public sealed class GlyphOutlineReader
Inheritance
GlyphOutlineReader
Inherited Members

Remarks

Coordinates are integer font units; divide by UnitsPerEm to reach em space. Instances are not thread-safe: decode from one thread, or create one reader per thread.

Properties

Format

Gets the outline representation the program carries.

GlyphCount

Gets the number of glyphs the program can decode.

IsCidKeyed

Gets a value indicating whether the program is a CID-keyed CFF.

UnitsPerEm

Gets the design units per em that outline coordinates are expressed in.

Methods

Create(ReadOnlyMemory<byte>, string, int, IConversionDiagnostics?)

Creates a reader over one font program: a TTF, an OTF, a bare CFF program, or one face of a TTC/OTC selected by faceIndex.

GetGlyphName(ushort)

Gets the name a name-keyed program gives a glyph, or null.

TryGetGlyphId(string, out ushort)

Resolves a glyph name to a glyph id, for programs that name their glyphs.

TryGetGlyphIdForCid(int, out ushort)

Resolves a character identifier to a glyph id in a CID-keyed CFF program.

TryGetOutline(ushort, out GlyphOutline)

Decodes one glyph outline.