FontFace extension type

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

This interface defines the source of a font face, either a URL to an external resource or a buffer, and font properties such as style, weight, and so on. For URL font sources it allows authors to trigger when the remote font is fetched and loaded, and to track loading status.


API documentation sourced from MDN Web Docs.

on
Implemented types
Available extensions

Constructors

FontFace(String family, JSAny source, [FontFaceDescriptors descriptors])
factory

Properties

ascentOverride String
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.
getter/setter pair
descentOverride String
The descentOverride property of the FontFace interface returns and sets the value of the descriptor. The possible values are normal, indicating that the metric used should be obtained from the font file, or a percentage.
getter/setter pair
display String
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. This property is equivalent to the CSS font-display descriptor.
getter/setter pair
family String
The FontFace.family property allows the author to get or set the font family of a FontFace object.
getter/setter pair
featureSettings String
The featureSettings property of the FontFace interface retrieves or sets infrequently used font features that are not available from a font's variant properties.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
lineGapOverride String
The lineGapOverride property of the FontFace interface returns and sets the value of the descriptor. The possible values are normal, indicating that the metric used should be obtained from the font file, or a percentage.
getter/setter pair
loaded JSPromise<FontFace>
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.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status FontFaceLoadStatus
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".
no setter
stretch String
The stretch property of the FontFace interface retrieves or sets how the font stretches.
getter/setter pair
style String
The style property of the FontFace interface retrieves or sets the font's style.
getter/setter pair
unicodeRange String
The unicodeRange property of the FontFace interface retrieves or sets the range of unicode code points encompassing the font.
getter/setter pair
weight String
The weight property of the FontFace interface retrieves or sets the weight of the font.
getter/setter pair

Methods

load() JSPromise<FontFace>
The load() method of the FontFace interface requests and loads a font whose source was specified as a URL. It returns a Promise that resolves with the current FontFace object.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited