Click or drag to resize
Pdf Library for .NET

PdfSystemFont Class

Descriptor for a system-installed font. Resolves to an actual font file on the host machine via PdfSystemFonts when the descriptor is handed to Add(PdfSystemFont) or CreateFromSystemFont(PdfSystemFont).
Inheritance Hierarchy
SystemObject
  SelectPdf.UniversalPdfSystemFont

Namespace: SelectPdf.Universal
Assembly: SelectPdf.HtmlToPdf.Universal (in SelectPdf.HtmlToPdf.Universal.dll) Version: 26.4
Syntax
public class PdfSystemFont

The PdfSystemFont type exposes the following members.

Constructors
 NameDescription
Public methodPdfSystemFont(String, Single)Creates a system-font descriptor with Regular style.
Public methodPdfSystemFont(String, Single, PdfFontStyle)Creates a system-font descriptor with the specified family / size / style.
Top
Properties
 NameDescription
Public propertyFamilyNameGets the system font family name (e.g. "Arial", "Times New Roman").
Public propertySizeGets the font size in points.
Public propertyStyleGets the requested style variant (Regular, Bold, Italic, Bold+Italic).
Top
Methods
 NameDescription
Public methodToStringReturns a string representation of this system font (family, size and, when set, style).
(Overrides ObjectToString)
Top
Remarks
The descriptor itself does not load any font data. Loading happens at the moment the descriptor is converted to a PdfFont; the resolved font is always subset-embedded into the output document.
Example
PdfSystemFont descriptor = new PdfSystemFont("Arial", 12f, PdfFontStyle.Bold);
PdfDocument document = new PdfDocument();
document.Fonts.Add(descriptor);
See Also