Chartbreaker
    Preparing search index...

    Interface FontFaceSet

    The FontFaceSet interface of the CSS Font Loading API manages the loading of font-faces and querying of their download status.

    MDN Reference

    interface FontFaceSet {
        "[toStringTag]": string;
        onloading: ((this: FontFaceSet, ev: FontFaceSetLoadEvent) => any) | null;
        onloadingdone:
            | ((this: FontFaceSet, ev: FontFaceSetLoadEvent) => any)
            | null;
        onloadingerror:
            | ((this: FontFaceSet, ev: FontFaceSetLoadEvent) => any)
            | null;
        ready: Promise<FontFaceSet>;
        size: number;
        status: FontFaceSetLoadStatus;
        "[iterator]"(): SetIterator<FontFace>;
        add(value: FontFace): this;
        addEventListener<K extends keyof FontFaceSetEventMap>(
            type: K,
            listener: (this: FontFaceSet, ev: FontFaceSetEventMap[K]) => any,
            options?: boolean | AddEventListenerOptions,
        ): void;
        addEventListener(
            type: string,
            listener: EventListenerOrEventListenerObject,
            options?: boolean | AddEventListenerOptions,
        ): void;
        check(font: string, text?: string): boolean;
        clear(): void;
        delete(value: FontFace): boolean;
        difference<U>(other: ReadonlySetLike<U>): Set<FontFace>;
        dispatchEvent(event: Event): boolean;
        entries(): SetIterator<[FontFace, FontFace]>;
        forEach(
            callbackfn: (
                value: FontFace,
                key: FontFace,
                parent: FontFaceSet,
            ) => void,
            thisArg?: any,
        ): void;
        has(value: FontFace): boolean;
        intersection<U>(other: ReadonlySetLike<U>): Set<FontFace & U>;
        isDisjointFrom(other: ReadonlySetLike<unknown>): boolean;
        isSubsetOf(other: ReadonlySetLike<unknown>): boolean;
        isSupersetOf(other: ReadonlySetLike<unknown>): boolean;
        keys(): SetIterator<FontFace>;
        load(font: string, text?: string): Promise<FontFace[]>;
        removeEventListener<K extends keyof FontFaceSetEventMap>(
            type: K,
            listener: (this: FontFaceSet, ev: FontFaceSetEventMap[K]) => any,
            options?: boolean | EventListenerOptions,
        ): void;
        removeEventListener(
            type: string,
            listener: EventListenerOrEventListenerObject,
            options?: boolean | EventListenerOptions,
        ): void;
        symmetricDifference<U>(other: ReadonlySetLike<U>): Set<FontFace | U>;
        union<U>(other: ReadonlySetLike<U>): Set<FontFace | U>;
        values(): SetIterator<FontFace>;
    }

    Hierarchy (View Summary)

    Index

    Properties

    "[toStringTag]": string
    onloading: ((this: FontFaceSet, ev: FontFaceSetLoadEvent) => any) | null
    onloadingdone: ((this: FontFaceSet, ev: FontFaceSetLoadEvent) => any) | null
    onloadingerror: ((this: FontFaceSet, ev: FontFaceSetLoadEvent) => any) | null
    ready: Promise<FontFaceSet>

    The ready read-only property of the FontFaceSet interface returns a Promise that resolves to the given FontFaceSet.

    MDN Reference

    size: number

    the number of (unique) elements in Set.

    The status read-only property of the FontFaceSet interface returns the loading state of the fonts in the set.

    MDN Reference

    Methods

    • Appends a new element with a specified value to the end of the Set.

      Parameters

      Returns this

    • The check() method of the FontFaceSet returns true if you can render some text using the given font specification without attempting to use any fonts in this FontFaceSet that are not yet fully loaded. This means you can use the font specification without causing a font swap.

      MDN Reference

      Parameters

      • font: string
      • Optionaltext: string

      Returns boolean

    • Removes all elements from the Set.

      Returns void

    • Removes a specified value from the Set.

      Parameters

      Returns boolean

      Returns true if an element in the Set existed and has been removed, or false if the element does not exist.

    • The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().

      MDN Reference

      Parameters

      Returns boolean

    • Parameters

      Returns void

    • Parameters

      Returns boolean

      a boolean indicating whether an element with the specified value exists in the Set or not.

    • Parameters

      Returns boolean

      a boolean indicating whether this Set has no elements in common with the argument.

    • Parameters

      Returns boolean

      a boolean indicating whether all the elements in this Set are also in the argument.

    • Parameters

      Returns boolean

      a boolean indicating whether all the elements in the argument are also in this Set.

    • The load() method of the FontFaceSet forces all the fonts given in parameters to be loaded.

      MDN Reference

      Parameters

      • font: string
      • Optionaltext: string

      Returns Promise<FontFace[]>

    • The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.

      MDN Reference

      Type Parameters

      Parameters

      Returns void

    • The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.

      MDN Reference

      Parameters

      Returns void