ComPDFKit Web SDK
    Preparing search index...

    Interface FontsAPI

    UI.Fonts: the font lists offered by the font dropdowns, the typed signature tab and the content editing font size dropdown.

    interface FontsAPI {
        addAnnotationFont(font: FontInput): void;
        addSignatureFont(font: string): void;
        getAnnotationFonts(): FontItem[];
        getFontSizes(): number[];
        getSignatureFonts(): string[];
        removeAnnotationFont(font: FontInput): void;
        removeSignatureFont(font: string): void;
        setAnnotationFonts(fonts: FontInput[]): void;
        setFontSizes(fontSizes: number[]): void;
        setSignatureFonts(fonts: string[]): void;
    }
    Index
    • Appends a font to the font dropdowns; warns and does nothing when an equal font is already listed.

      Parameters

      • font: FontInput

        A font name, or a font item.

      Returns void

      instance.UI.Fonts.addAnnotationFont('Helvetica');
      
    • Appends a font to the type tab of the signature dialog; warns and does nothing when it is already listed.

      Parameters

      • font: string

        Font name.

      Returns void

    • Returns the fonts of the font dropdowns (annotation style, form field and content editing panels).

      Returns FontItem[]

      A copy of the font items.

    • Returns the font size options of the content editing panel.

      Returns number[]

      A copy of the sizes.

    • Returns the fonts offered by the type tab of the signature dialog.

      Returns string[]

      A copy of the font names.

    • Removes the first matching font from the font dropdowns; warns when none matches. A string matches the family or the name; an item must match both.

      Parameters

      • font: FontInput

        A font name, or a font item.

      Returns void

    • Removes a font from the type tab of the signature dialog; warns when it is not listed.

      Parameters

      • font: string

        Font name.

      Returns void

    • Replaces all fonts of the font dropdowns.

      Parameters

      • fonts: FontInput[]

        Font names or font items, in display order.

      Returns void

      instance.UI.Fonts.setAnnotationFonts(['Helvetica', 'Times-Roman']);
      
    • Replaces the font size options of the content editing panel.

      Parameters

      • fontSizes: number[]

        Font sizes, in display order.

      Returns void

      instance.UI.Fonts.setFontSizes([8, 10, 12, 14, 18, 24, 36]);
      
    • Replaces all fonts of the type tab of the signature dialog.

      Parameters

      • fonts: string[]

        Font names, in display order.

      Returns void

      instance.UI.Fonts.setSignatureFonts(['Arial', 'Times New Roman']);