FontFace

open class FontFace(var family: String, source: String, descriptors: FontFaceDescriptors = definedExternally)(source)

The FontFace interface of the CSS Font Loading API represents a single usable font face.

MDN Reference

Constructors

Link copied to clipboard
constructor(family: String, source: BufferSource, descriptors: FontFaceDescriptors = definedExternally)
constructor(family: String, source: String, descriptors: FontFaceDescriptors = definedExternally)

Properties

Link copied to clipboard

The ascentOverride property of the FontFace interface returns and sets the ascent metric for the font, the height above the baseline that CSS uses to lay out line boxes in an inline formatting context.

Link copied to clipboard

The descentOverride property of the FontFace interface returns and sets the value of the @font-face/descent-override descriptor.

Link copied to clipboard

The display property of the FontFace interface determines how a font face is displayed based on whether and when it is downloaded and ready to use.

Link copied to clipboard

The FontFace.family property allows the author to get or set the font family of a FontFace object.

Link copied to clipboard

The featureSettings property of the FontFace interface retrieves or sets infrequently used font features that are not available from a font's variant properties.

Link copied to clipboard

The lineGapOverride property of the FontFace interface returns and sets the value of the @font-face/line-gap-override descriptor.

Link copied to clipboard

The loaded read-only property of the FontFace interface returns a Promise that resolves with the current FontFace object when the font specified in the object's constructor is done loading or rejects with a SyntaxError.

Link copied to clipboard

The status read-only property of the FontFace interface returns an enumerated value indicating the status of the font, one of 'unloaded', 'loading', 'loaded', or 'error'.

Link copied to clipboard

The stretch property of the FontFace interface retrieves or sets how the font stretches.

Link copied to clipboard

The style property of the FontFace interface retrieves or sets the font's style.

Link copied to clipboard

The unicodeRange property of the FontFace interface retrieves or sets the range of unicode code points encompassing the font.

Link copied to clipboard

The weight property of the FontFace interface retrieves or sets the weight of the font.

Functions

Link copied to clipboard
suspend fun load(): FontFace

The load() method of the FontFace interface requests and loads a font whose source was specified as a URL.

Link copied to clipboard