 |
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.UniversalAssembly: SelectPdf.HtmlToPdf.Universal (in SelectPdf.HtmlToPdf.Universal.dll) Version: 26.4
Syntaxpublic static PdfFont CreateFromSystemFont(
string familyName,
float size
)
Public Shared Function CreateFromSystemFont (
familyName As String,
size As Single
) As PdfFont
Parameters
- familyName String
- An installed font family name (see
InstalledFamilies).
- size Single
- The font size in points.
Return Value
PdfFontA new
PdfFont backed by the embedded system font.
Exceptions| Exception | Condition |
|---|
| PdfDocumentException | Thrown if the family is not installed or
its font file cannot be read. |
Exampleif (PdfSystemFonts.IsFamilyInstalled("Arial"))
{
PdfFont font = PdfFont.CreateFromSystemFont("Arial", 12f);
}If PdfSystemFonts.IsFamilyInstalled("Arial") Then
Dim font As PdfFont = PdfFont.CreateFromSystemFont("Arial", 12.0F)
End If
See Also