Method TryGetFontProgram
TryGetFontProgram(FontFace, out ReadOnlyMemory<byte>)
Tries to get the font program backing a resolved face whose source is held in memory — a document-embedded payload or one of the bundled metric-compatible fonts — rather than stored as a file on disk.
public bool TryGetFontProgram(FontFace face, out ReadOnlyMemory<byte> fontProgram)
Parameters
faceFontFaceThe resolved face.
fontProgramReadOnlyMemory<byte>The font program on success: the whole container, so a face taken from a collection is still addressed by the face index carried in SourceName.
Returns
- bool
true when the face is backed by an in-memory source; false when its source is a path the caller should read itself.
Remarks
Consumers that embed or rasterize outlines (the PDF and imaging renderers) read a file-backed face straight from its source path; an in-memory source has no such path, so without this seam a bundled or embedded face cannot be drawn at all. Bytes are produced on demand rather than hung off FontFace, because the resolution cache holds one face per indexed font and binding payloads to faces would keep every scanned font resident.
Exceptions
- ArgumentNullException
faceis null.