Implements

Constructors

  • Creates an instance of PDFFont. Instead of creating an instance in new mode, use create to create an instance.

    Parameters

    • options: Options

      Create a PDFFont instance with the specified options.

    Returns PDFFont

    const pdfFont = await PDFFont.create();
    

Properties

options: Options

Methods

  • Retrieves the character code for a given Unicode string.

    Parameters

    • unicode: string

      A Unicode string representing one or more characters.

    Returns Promise<number>

    A promise that resolves to a number representing the character code.

  • Retrieves the embedded font.

    Parameters

    • doc: DocType

      The document in which to create the embedded font.

    • fontPath: string

      The path to the font file.

    • unicodeArr: string[]

      The array of Unicode characters to embed.

    Returns Promise<null | PDFFontType>

    A promise that resolves to a PDFFont instance representing the embedded font.

  • Destroys the PDFFont object.

    Returns Promise<void>

    A promise that resolves when the object is destroyed.

  • Retrieves the document associated with the font.

    Returns Promise<null | DocType>

    A promise that resolves to a Doc instance or null if not found.

  • Retrieves the font type.

    Returns Promise<number>

    A promise that resolves to a number representing the font type.

  • Retrieves the name of the font type.

    Returns Promise<string>

    A promise that resolves to a string containing the name of the font type.

  • Retrieves the standard font from the document.

    Parameters

    • doc: DocType

      The document from which to retrieve the font.

    • fontName: string

      The name of the font to retrieve.

    Returns Promise<null | PDFFontType>

    • A promise that resolves to a PDFFont instance or null if not found.
  • Checks if the font is a standard font.

    Returns Promise<boolean>

    A promise that resolves to a boolean indicating whether the font is a standard font.

  • Creates an instance of PDFFont.

    Parameters

    • Optionaloptions: Options

      The configuration options required for creation, containing necessary initialization information.

    Returns Promise<PDFFontType>

    A Promise object containing an instance of PDFFont.

    const pdfFont = await PDFFont.create();