@diffusionstudio/core-v4
Version:
2D motion graphics and video rendering engine
40 lines (39 loc) • 1.31 kB
TypeScript
import { Serializer } from '../services';
import { WebFonts } from './fixtures';
import { Font } from '../renderer';
import type * as types from './types';
export declare class FontManager extends Serializer {
/**
* The fonts that have been loaded
*/
loadedFonts: types.FontSource[];
/**
* Load the font that has been initiated via the constructor
*/
load<T extends keyof typeof WebFonts>(options: types.FontSource | types.WebfontProperties<T>): Promise<Font>;
/**
* Reload all fonts
* @deprecated Use restoreCheckpoint instead
*/
reload(): Promise<void>;
/**
* Get all available local fonts, requires the
* **Local Font Access API**
*/
static localFonts(): Promise<types.FontSources[]>;
/**
* Get common web fonts
*/
static webFonts(): types.FontSources[];
static load<T extends keyof typeof WebFonts>(options: types.FontSource | types.WebfontProperties<T>): Promise<Font>;
copy(): FontManager;
/**
* Create a checkpoint of the current font manager state
*/
createCheckpoint(): Promise<unknown>;
/**
* Restore the font manager state from a checkpoint
* @param checkpoint - The checkpoint to restore from
*/
restoreCheckpoint(checkpoint: unknown): Promise<void>;
}