Package com.independentsoft.office.pdf

# Class PdfFontManager

java.lang.Object
com.independentsoft.office.pdf.PdfFontManager

public class PdfFontManager extends Object
Resolves document font families to TrueType font files and manages the fonts embedded in a PDF file. Fonts registered on `PdfSaveOptions` take precedence; otherwise the configured font directories and the operating system font directories are searched.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PdfFontManager​(PdfSaveOptions options)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `List<EmbeddedFont>`
  `getEmbeddedFonts()`
  Gets all fonts embedded so far, in resource name order (EF1, EF2, ...).
  `EmbeddedFont`
  `resolve​(String family, boolean bold, boolean italic)`
  Resolves a font family and style to an embedded font, loading and registering it on first use.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### PdfFontManager

    public PdfFontManager​(PdfSaveOptions options)

- ## Method Details

  - ### resolve

    public EmbeddedFont resolve​(String family, boolean bold, boolean italic)
    Resolves a font family and style to an embedded font, loading and registering it on first use. Returns null when no suitable TrueType font can be found, in which case the caller should fall back to the standard base-14 fonts.
    Parameters:
      `family` - the font family name from the document
      `bold` - true for the bold variant
      `italic` - true for the italic variant
    Returns:
      the embedded font or null

  - ### getEmbeddedFonts

    public List<EmbeddedFont> getEmbeddedFonts()
    Gets all fonts embedded so far, in resource name order (EF1, EF2, ...).
    Returns:
      the embedded fonts