UNPKG

@lightningjs/renderer

Version:
26 lines (25 loc) 1.03 kB
import type { FontFamilyMap, FontLoadOptions, NormalizedFontMetrics } from './TextRenderer.js'; import type { Stage } from '../Stage.js'; /** * Check if a font can be rendered */ export declare const canRenderFont: () => boolean; /** * Load a font by providing fontFamily, fontUrl, and optional metrics */ export declare const loadFont: (stage: Stage, options: FontLoadOptions) => Promise<void>; /** * Get the font families map for resolving fonts */ export declare const getFontFamilies: () => FontFamilyMap; /** * Initialize the global font handler */ export declare const init: (c?: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D) => void; export declare const type = "canvas"; /** * Check if a font is already loaded by font family */ export declare const isFontLoaded: (fontFamily: string) => boolean; export declare const getFontMetrics: (fontFamily: string, fontSize: number) => NormalizedFontMetrics; export declare const setFontMetrics: (fontFamily: string, metrics: NormalizedFontMetrics) => void;