DsPdfJS API - v9.1.0
    Preparing search index...

    Class FontCollection

    Represents a collection of fonts.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get count(): number

      Gets the number of fonts in the FontCollection.

      Returns number

    • get defaultFont(): Font | null

      Gets or sets the default font for the current font collection.

      Returns Font | null

    • set defaultFont(font: Font | null): void

      Gets or sets the default font for the current font collection.

      Parameters

      Returns void

    • get id(): number

      Gets the reference to the object.

      Returns number

    Methods

    • Adds the specified font as fallback to the FontCollection.

      Parameters

      • font: Font

        The Font to be added as fallback font.

      Returns void

    • Adds the specified font to the FontCollection.

      Parameters

      • font: Font

        The Font object to add, if the Font is not yet added.

      • OptionalfallbackFont: boolean = false

        true if the font should also be added to the list of fallback fonts, false otherwise.

      • OptionaldefaultFont: boolean = false

        true if the font should be set as default font, false otherwise.

      Returns void

    • Clears the list of fallback fonts in the FontCollection.

      Returns void

    • Determines whether the font is in the FontCollection.

      Parameters

      • font: Font

        The Font to be searched.

      Returns boolean

    • Detaches the object from the ObjectManager and deallocates its memory, if possible.

      Returns void

    • Gets the font with the specified index from the FontCollection.

      Parameters

      • index: number

      Returns Font

    • Gets the index of the font in the FontCollection, or -1 if the font is not found.

      Parameters

      Returns number

    • Loads a font or font collection from the byte array.

      Parameters

      • fontBytes: Uint8Array

        The binary data of the font.

      • OptionalfallbackFont: boolean = false

        true if the font should be added to the list of fallback fonts, false otherwise.

      • OptionaldefaultFont: boolean = false

        true if the font should be set as default font, false otherwise.

      Returns void

    • Removes the specified font from the FontCollection.

      Parameters

      • font: Font

        The Font to be removed from the collection.

      Returns boolean

      true if the font was actually removed, false otherwise.

    • Removes a font at the specified index.

      Parameters

      • index: number

      Returns void

    • Removes the specified font from fallbacks of the FontCollection.

      Parameters

      • font: Font

        The Font to be removed from fallback fonts.

      Returns void