Skip to content

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 ​

ts
onloading: ((this, event) => void) | null;

Defined in: types/desktop-engine.d.ts:5289


onloadingdone ​

ts
onloadingdone: ((this, event) => void) | null;

Defined in: types/desktop-engine.d.ts:5290


onloadingerror ​

ts
onloadingerror: ((this, event) => void) | null;

Defined in: types/desktop-engine.d.ts:5291


ready ​

ts
readonly ready: Promise<FontFaceSet>;

Defined in: types/desktop-engine.d.ts:5293

Resolves with the set when none of its faces is loading


size ​

ts
readonly size: number;

Defined in: types/desktop-engine.d.ts:5296


status ​

ts
readonly status: FontFaceSetLoadStatus;

Defined in: types/desktop-engine.d.ts:5295

"loading" while some of its faces are

Methods ​

[iterator]() ​

ts
iterator: IterableIterator<FontFace>;

Defined in: types/desktop-engine.d.ts:5318

Returns ​

IterableIterator<FontFace>


add() ​

ts
add(font): FontFaceSet;

Defined in: types/desktop-engine.d.ts:5298

Adds a face (a TypeError for anything else); returns the set

Parameters ​

ParameterType
fontFontFace

Returns ​

FontFaceSet


addEventListener() ​

ts
addEventListener<K>(
   type, 
   listener, 
   options?
): void;

Defined in: types/desktop-engine.d.ts:4865

Type Parameters ​

Type Parameter
K extends keyof FontFaceSetEventMap

Parameters ​

ParameterType
typeK
listener(this, event) => void
options?AddEventListenerOptions

Returns ​

void

Inherited from ​

EventTarget.addEventListener


check() ​

ts
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 ​

ParameterType
fontstring
text?string

Returns ​

boolean


clear() ​

ts
clear(): void;

Defined in: types/desktop-engine.d.ts:5301

Returns ​

void


delete() ​

ts
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 ​

ParameterType
fontFontFace

Returns ​

boolean


dispatchEvent() ​

ts
dispatchEvent(event): boolean;

Defined in: types/desktop-engine.d.ts:4868

Returns false when a listener called preventDefault() on a cancelable event

Parameters ​

ParameterType
eventEvent

Returns ​

boolean

Inherited from ​

EventTarget.dispatchEvent


entries() ​

ts
entries(): IterableIterator<[FontFace, FontFace]>;

Defined in: types/desktop-engine.d.ts:5315

Returns ​

IterableIterator<[FontFace, FontFace]>


forEach() ​

ts
forEach(callback, thisArg?): void;

Defined in: types/desktop-engine.d.ts:5303

Parameters ​

ParameterType
callback(font, key, set) => void
thisArg?any

Returns ​

void


has() ​

ts
has(font): boolean;

Defined in: types/desktop-engine.d.ts:5302

Parameters ​

ParameterType
fontFontFace

Returns ​

boolean


keys() ​

ts
keys(): IterableIterator<FontFace>;

Defined in: types/desktop-engine.d.ts:5316

Returns ​

IterableIterator<FontFace>


load() ​

ts
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 ​

ParameterType
fontstring
text?string

Returns ​

Promise<FontFace[]>


removeEventListener() ​

ts
removeEventListener<K>(type, listener): void;

Defined in: types/desktop-engine.d.ts:4866

Type Parameters ​

Type Parameter
K extends keyof FontFaceSetEventMap

Parameters ​

ParameterType
typeK
listener(this, event) => void

Returns ​

void

Inherited from ​

EventTarget.removeEventListener


values() ​

ts
values(): IterableIterator<FontFace>;

Defined in: types/desktop-engine.d.ts:5317

Returns ​

IterableIterator<FontFace>

The SDK is released under the Apache License 2.0