import * as ds from "./Types"; import { ObjectManager } from "./ObjectManager"; import { ObjectBase } from "./ObjectBase"; import { type Font } from "./Font"; /** * Represents a collection of fonts. **/ export declare class FontCollection extends ObjectBase { /** * Creates an empty {@link FontCollection} instance. **/ constructor(); /** * Creates an empty {@link FontCollection} instance. * @param om An object manager that controls the lifetime of the {@link FontCollection} object. **/ constructor(om: ObjectManager); /** * Gets the default {@link FontCollection} instance. * @returns The default {@link FontCollection} instance. **/ static getDefaultCollection(): FontCollection; /** * Gets the default {@link FontCollection} instance. * @param om An object manager that controls the lifetime of the {@link FontCollection} object. * @returns The default {@link FontCollection} instance. **/ static getDefaultCollection(om: ObjectManager): FontCollection; /** * Gets or sets the default font for the current font collection. **/ get defaultFont(): Font | null; /** * Gets or sets the default font for the current font collection. **/ set defaultFont(font: Font | null); /** * Loads a font or font collection from the byte array. * @param fontBytes The binary data of the font. * @param [fallbackFont=false] true if the font should be added to the list of fallback fonts, false otherwise. * @param [defaultFont=false] true if the font should be set as default font, false otherwise. **/ loadFont(fontBytes: Uint8Array, fallbackFont?: boolean, defaultFont?: boolean): void; /** * Adds the specified font to the {@link FontCollection}. * @param font The {@link Font} object to add, if the {@link Font} is not yet added. * @param [fallbackFont=false] true if the font should also be added to the list of fallback fonts, false otherwise. * @param [defaultFont=false] true if the font should be set as default font, false otherwise. **/ addFont(font: Font, fallbackFont?: boolean, defaultFont?: boolean): void; /** * Searches for a font with specified options in the {@link FontCollection}. * @returns The {@link Font} found, or null if not found. **/ searchFont(searchFontOptions: ds.SearchFontOptions): Font | null; [Symbol.iterator](): Generator; /** * Gets the number of fonts in the {@link FontCollection}. **/ get count(): number; /** * Gets the font with the specified index from the {@link FontCollection}. **/ getAt(index: number): Font; /** * Determines whether the font is in the {@link FontCollection}. * @param font The Font to be searched. **/ contains(font: Font): boolean; /** * Gets the index of the font in the {@link FontCollection}, or -1 if the font is not found. * @param font The {@link Font} to be searched. **/ indexOf(font: Font): number; /** * Removes the specified font from the {@link FontCollection}. * @param font The {@link Font} to be removed from the collection. * @returns true if the font was actually removed, false otherwise. **/ remove(font: Font): boolean; /** * Removes a font at the specified index. **/ removeAt(index: number): void; /** * Removes all fonts from the {@link FontCollection}. **/ clear(): void; /** * Adds the specified font as fallback to the {@link FontCollection}. * @param font The {@link Font} to be added as fallback font. **/ addFallbackFont(font: Font): void; /** * Removes the specified font from fallbacks of the {@link FontCollection}. * @param font The {@link Font} to be removed from fallback fonts. **/ removeFallbackFont(font: Font): void; /** * Clears the list of fallback fonts in the {@link FontCollection}. **/ clearFallbackFonts(): void; /** * Creates a copy of the {@link FontCollection}. **/ clone(): FontCollection; }