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>

获取给定 Unicode 字符串的字符编码。

Type declaration

    • (unicode: string): Promise<number>
    • Parameters

      • unicode: string

        表示一个或多个字符的 Unicode 字符串。

      Returns Promise<number>

      一个 Promise,解析为表示字符编码的数字。

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

获取嵌入的字体。

Type declaration

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

      • doc: DocType

        要在其中创建嵌入字体的文档。

      • fontPath: string

        字体文件的路径。

      • unicodeArr: string[]

        要嵌入的 Unicode 字符数组。

      Returns Promise<null | PDFFontType>

      一个 Promise,解析为表示嵌入字体的 PDFFont 实例。

destroy: () => Promise<void>

销毁 PDFFont 对象。

Type declaration

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

      当对象被销毁时 resolve 的 Promise。

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

获取与该字体关联的文档。

Type declaration

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

      一个 Promise,解析为 Doc 实例,如果未找到则为 null。

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

获取字体字典。

Type declaration

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

      一个 Promise,解析为 PDFObjectType 实例,如果未找到则为 null。

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

获取字体列表。

Type declaration

getFontType: () => Promise<number>

获取字体类型。

Type declaration

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

      一个 Promise,解析为表示字体类型的数字。

getFontTypeName: () => Promise<string>

获取字体类型的名称。

Type declaration

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

      一个 Promise,解析为包含字体类型名称的字符串。

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

从文档中获取标准字体。

Type declaration

    • (doc: DocType, fontName: string): Promise<null | PDFFontType>
    • Parameters

      • doc: DocType

        要从中获取字体的文档。

      • fontName: string

        要获取的字体名称。

      Returns Promise<null | PDFFontType>

      • 一个 Promise,解析为 PDFFont 实例,如果未找到则为 null。
isStandardFont: () => Promise<boolean>

检查该字体是否为标准字体。

Type declaration

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

      一个 Promise,解析为一个布尔值,用于指示该字体是否为标准字体。

options: Options