Click or drag to resize
Pdf Library for .NET

PdfSystemFontsLoadFontBytes Method

Resolves a system font to its raw font-file bytes (TrueType / OpenType). Throws PdfDocumentException if the family isn't installed or its bytes can't be read.

Namespace: SelectPdf.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntax
public static byte[] LoadFontBytes(
	string familyName,
	PdfFontStyle style
)

Parameters

familyName  String
An installed (or bundled) font family name.
style  PdfFontStyle
Which weight / slant variant of the family to load.

Return Value

Byte
The raw TrueType / OpenType font-file bytes.
Exceptions
ExceptionCondition
PdfDocumentExceptionThrown if the family isn't installed or its bytes can't be read.
Remarks
Returned bytes can be passed to CreateFromBytes(Byte, Single). On macOS this may be the contents of a single face inside a .ttc collection.
See Also