Interface: FontFaceSet
Defined in: types/desktop-engine.d.ts:5288
The faces canvases draw with, DesktopEngine.fonts: a set of FontFace objects, as document.fonts is on the web. A family's face is picked as CSS picks it: by style first (italic falls back to oblique, then to normal), then by the weight closest in CSS's order.
Extends
Properties
onloading
onloading: ((this, event) => void) | null;Defined in: types/desktop-engine.d.ts:5289
onloadingdone
onloadingdone: ((this, event) => void) | null;Defined in: types/desktop-engine.d.ts:5290
onloadingerror
onloadingerror: ((this, event) => void) | null;Defined in: types/desktop-engine.d.ts:5291
ready
readonly ready: Promise<FontFaceSet>;Defined in: types/desktop-engine.d.ts:5293
Resolves with the set when none of its faces is loading
size
readonly size: number;Defined in: types/desktop-engine.d.ts:5296
status
readonly status: FontFaceSetLoadStatus;Defined in: types/desktop-engine.d.ts:5295
"loading" while some of its faces are
Methods
[iterator]()
iterator: IterableIterator<FontFace>;Defined in: types/desktop-engine.d.ts:5318
Returns
IterableIterator<FontFace>
add()
add(font): FontFaceSet;Defined in: types/desktop-engine.d.ts:5298
Adds a face (a TypeError for anything else); returns the set
Parameters
| Parameter | Type |
|---|---|
font | FontFace |
Returns
FontFaceSet
addEventListener()
addEventListener<K>(
type,
listener,
options?
): void;Defined in: types/desktop-engine.d.ts:4865
Type Parameters
| Type Parameter |
|---|
K extends keyof FontFaceSetEventMap |
Parameters
| Parameter | Type |
|---|---|
type | K |
listener | (this, event) => void |
options? | AddEventListenerOptions |
Returns
void
Inherited from
check()
check(font, text?): boolean;Defined in: types/desktop-engine.d.ts:5314
Whether the set's faces a CSS font picks are loaded; true when it picks none (installed fonts are always there). Throws a "SyntaxError" DOMException for what isn't a font with families. text is ignored
Parameters
| Parameter | Type |
|---|---|
font | string |
text? | string |
Returns
boolean
clear()
clear(): void;Defined in: types/desktop-engine.d.ts:5301
Returns
void
delete()
delete(font): boolean;Defined in: types/desktop-engine.d.ts:5300
Removes a face: canvases no longer draw with it. Whether it was there
Parameters
| Parameter | Type |
|---|---|
font | FontFace |
Returns
boolean
dispatchEvent()
dispatchEvent(event): boolean;Defined in: types/desktop-engine.d.ts:4868
Returns false when a listener called preventDefault() on a cancelable event
Parameters
| Parameter | Type |
|---|---|
event | Event |
Returns
boolean
Inherited from
entries()
entries(): IterableIterator<[FontFace, FontFace]>;Defined in: types/desktop-engine.d.ts:5315
Returns
IterableIterator<[FontFace, FontFace]>
forEach()
forEach(callback, thisArg?): void;Defined in: types/desktop-engine.d.ts:5303
Parameters
| Parameter | Type |
|---|---|
callback | (font, key, set) => void |
thisArg? | any |
Returns
void
has()
has(font): boolean;Defined in: types/desktop-engine.d.ts:5302
Parameters
| Parameter | Type |
|---|---|
font | FontFace |
Returns
boolean
keys()
keys(): IterableIterator<FontFace>;Defined in: types/desktop-engine.d.ts:5316
Returns
IterableIterator<FontFace>
load()
load(font, text?): Promise<FontFace[]>;Defined in: types/desktop-engine.d.ts:5309
Loads the set's faces a CSS font ("bold 16px Pixel") picks, one for each of its families that has some; resolves with them, rejects with the first face's error, or with a "SyntaxError" DOMException for what isn't a font with families. text is ignored
Parameters
| Parameter | Type |
|---|---|
font | string |
text? | string |
Returns
Promise<FontFace[]>
removeEventListener()
removeEventListener<K>(type, listener): void;Defined in: types/desktop-engine.d.ts:4866
Type Parameters
| Type Parameter |
|---|
K extends keyof FontFaceSetEventMap |
Parameters
| Parameter | Type |
|---|---|
type | K |
listener | (this, event) => void |
Returns
void
Inherited from
EventTarget.removeEventListener
values()
values(): IterableIterator<FontFace>;Defined in: types/desktop-engine.d.ts:5317
Returns
IterableIterator<FontFace>
