Click or drag to resize
Pdf Library for .NET

PdfFontCreateFromSystemFont(String, Single) Method

Resolves a font installed on the host system by family name and creates a PdfFont. Loads the actual TrueType / OpenType file via PdfSystemFonts and subset-embeds it into the output document.

Namespace: SelectPdf.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntax
public static PdfFont CreateFromSystemFont(
	string familyName,
	float size
)

Parameters

familyName  String
An installed font family name (see InstalledFamilies).
size  Single
The font size in points.

Return Value

PdfFont
A new PdfFont backed by the embedded system font.
Exceptions
ExceptionCondition
PdfDocumentExceptionThrown if the family is not installed or its font file cannot be read.
Example
if (PdfSystemFonts.IsFamilyInstalled("Arial"))
{
    PdfFont font = PdfFont.CreateFromSystemFont("Arial", 12f);
}
See Also