Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

PdfEmbeddedFontFamily

OfficeIMO.Pdf

Namespace
OfficeIMO.Pdf
Assembly
OfficeIMO.Pdf
Source revision
be6c300e4ab1 with working tree changes
Modifiers
sealed

Represents a caller-supplied TrueType font family used by generated PDF text.

Inheritance

  • object
  • PdfEmbeddedFontFamily

Usage

Explore 14 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 9

Constructors

public PdfEmbeddedFontFamily(string familyName, byte[] regular, byte[]? bold = null, byte[]? italic = null, byte[]? boldItalic = null) #

Creates a reusable TrueType font family from font file bytes.

Parameters

familyName string required
Family name used for generated PDF font resource names.
regular byte[] required
Regular TrueType face bytes.
bold byte[]? = null optional
Optional bold TrueType face bytes. When null, the selected regular face is emboldened while painting.
italic byte[]? = null optional
Optional italic TrueType face bytes. When null, generated italic text uses a slanted regular face.
boldItalic byte[]? = null optional
Optional bold-italic TrueType face bytes. When null, generated text uses the best supplied face and simulates the missing slant when needed.

Methods

public static PdfEmbeddedFontFamily FromFiles(string familyName, string regularPath, string? boldPath = null, string? italicPath = null, string? boldItalicPath = null) #

Creates a reusable TrueType font family from font files on disk.

Parameters

familyName string required
regularPath string required
boldPath string? = null optional
italicPath string? = null optional
boldItalicPath string? = null optional
public static PdfEmbeddedFontFamily FromSystem(string familyName, string? pdfFamilyName = null) #

Loads an installed TrueType font family from common operating-system font folders.

Parameters

familyName string required
Installed family name, for example Arial, Segoe UI, or DejaVu Sans.
pdfFamilyName string? = null optional
Optional family name to expose in generated PDF font resource names.

Returns

PdfEmbeddedFontFamily A reusable embedded font family backed by the discovered TrueType faces.

Exceptions

  • FileNotFoundException – No embeddable TrueType regular face was found for familyName.
public static bool TryFromSystem(string familyName, out PdfEmbeddedFontFamily? fontFamily, string? pdfFamilyName = null) #

Attempts to load an installed TrueType font family from common operating-system font folders.

Parameters

familyName string required
Installed family name, for example Arial, Segoe UI, or DejaVu Sans.
fontFamily OfficeIMO.Pdf.PdfEmbeddedFontFamily? required
When found, receives a reusable embedded font family backed by discovered TrueType faces.
pdfFamilyName string? = null optional
Optional family name to expose in generated PDF font resource names.

Returns

bool true when an embeddable regular TrueType face was found; otherwise false.

Properties

public string FamilyName { get; } #

Family name used for generated PDF font resource names.

public byte[] Regular { get; } #

Regular TrueType face bytes.

public byte[]? Bold { get; } #

Optional bold TrueType face bytes.

public byte[]? Italic { get; } #

Optional italic TrueType face bytes.

public byte[]? BoldItalic { get; } #

Optional bold-italic TrueType face bytes.