interface PDFFontType {
    charCodeFromUnicode: (unicode: string) => Promise<number>;
    createEmbedFont: (
        doc: DocType,
        fontPath: string,
        unicodeArr: string[],
    ) => Promise<null | PDFFontType>;
    destroy: () => Promise<void>;
    getDoc: () => Promise<null | DocType>;
    getFontDict: () => Promise<null | PDFObjectType>;
    getFontList: () => Promise<null | WideStringArrayType>;
    getFontType: () => Promise<number>;
    getFontTypeName: () => Promise<string>;
    getStockFont: (
        doc: DocType,
        fontName: string,
    ) => Promise<null | PDFFontType>;
    isStandardFont: () => Promise<boolean>;
    options: Options;
}

Implemented by

Properties

charCodeFromUnicode: (unicode: string) => Promise<number>

Retrieves the character code for a given Unicode string.

Type declaration

    • (unicode: string): Promise<number>
    • 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.

createEmbedFont: (
    doc: DocType,
    fontPath: string,
    unicodeArr: string[],
) => Promise<null | PDFFontType>

Retrieves the embedded font.

Type declaration

    • (
          doc: DocType,
          fontPath: string,
          unicodeArr: string[],
      ): Promise<null | PDFFontType>
    • 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.

destroy: () => Promise<void>

Destroys the PDFFont object.

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

      A promise that resolves when the object is destroyed.

getDoc: () => Promise<null | DocType>

Retrieves the document associated with the font.

Type declaration

    • (): Promise<null | DocType>
    • Returns Promise<null | DocType>

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

getFontDict: () => Promise<null | PDFObjectType>

Retrieves the font dictionary.

Type declaration

    • (): Promise<null | PDFObjectType>
    • Returns Promise<null | PDFObjectType>

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

getFontList: () => Promise<null | WideStringArrayType>

Retrieves the font list.

Type declaration

getFontType: () => Promise<number>

Retrieves the font type.

Type declaration

    • (): Promise<number>
    • Returns Promise<number>

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

getFontTypeName: () => Promise<string>

Retrieves the name of the font type.

Type declaration

    • (): Promise<string>
    • Returns Promise<string>

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

getStockFont: (doc: DocType, fontName: string) => Promise<null | PDFFontType>

Retrieves the standard font from the document.

Type declaration

    • (doc: DocType, fontName: string): Promise<null | PDFFontType>
    • 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.
isStandardFont: () => Promise<boolean>

Checks if the font is a standard font.

Type declaration

    • (): Promise<boolean>
    • Returns Promise<boolean>

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

options: Options