FontFaceSet

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

MDN Reference

Properties

Link copied to clipboard
abstract val ready: Promise<FontFaceSet>

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

Link copied to clipboard
abstract override val size: Int
Link copied to clipboard

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

Functions

Link copied to clipboard
abstract fun add(value: FontFace)
Link copied to clipboard
abstract fun check(font: String, text: String = definedExternally): Boolean

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.

Link copied to clipboard
abstract fun clear()
Link copied to clipboard
abstract fun delete(value: FontFace): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun forEach(action: (item: FontFace) -> Unit)
Link copied to clipboard
open operator fun get(key: Symbol.iterator): () -> JsIterator<FontFace>
Link copied to clipboard
abstract override fun has(key: FontFace): Boolean
Link copied to clipboard
open inline operator fun iterator(): Iterator<FontFace>
Link copied to clipboard
abstract fun keys(): JsIterator<FontFace>
Link copied to clipboard
abstract suspend fun load(font: String, text: String = definedExternally): ReadonlyArray<FontFace>

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

Link copied to clipboard
abstract fun loadAsync(font: String, text: String = definedExternally): Promise<ReadonlyArray<FontFace>>
Link copied to clipboard
abstract fun values(): JsIterator<FontFace>
Link copied to clipboard