package js.html
Available on js
The FontFace interface represents a single usable font face. It allows control of the source of the font face, being a URL to an external resource, or a buffer; it also allows control of when the font face is loaded and its current status.
Documentation FontFace by Mozilla Contributors, licensed under CC-BY-SA 2.5.
See also:
new(family:String, source:String, ?descriptors:Null<FontFaceDescriptors>)new(family:String, source:ArrayBuffer, ?descriptors:Null<FontFaceDescriptors>)new(family:String, source:ArrayBufferView, ?descriptors:Null<FontFaceDescriptors>)Throws:
null |
DOMError |
|---|
family:StringIs a CSSOMString that contains the family of the font. It is equivalent to the @font-face/font-family descriptor.
featureSettings:StringIs a CSSOMString that contains the features of the font. It is equivalent to the @font-face/font-feature-settingsdescriptor.
read onlyloaded:Promise<FontFace>Returns a Promise to a FontFace that fulfills when the font is completely loaded and rejects when an error happens.
read onlystatus:FontFaceLoadStatusReturns an enumerated value indicating the status of the font. It can be one of the following: "unloaded", "loading", "loaded", or "error".
stretch:StringIs a CSSOMString that contains how the font stretches. It is equivalent to the @font-face/font-stretch descriptor.
style:StringIs a CSSOMString that contains the style of the font. It is equivalent to the @font-face/font-style descriptor.
unicodeRange:StringIs a CSSOMString that contains the range of code encompassed the font. It is equivalent to the @font-face/unicode-range descriptor.
variant:StringIs a CSSOMString that contains the variant of the font. It is equivalent to the @font-face/font-variant descriptor.
weight:StringIs a CSSOMString that contains the weight of the font. It is equivalent to the @font-face/font-weight descriptor.
load():Promise<FontFace>Loads the font, returning a Promise to a FontFace that fulfills when the font is completely loaded and rejects when an error happens.
Throws:
null |
DOMError |
|---|
© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/FontFace.html