@manifold-studio/typeface
Version:
Font loading and text-to-3D conversion for Manifold Studio
67 lines • 1.87 kB
TypeScript
/**
* Font Loader - Main API for loading fonts and creating text
*
* This module provides the primary API that component authors will use
* to create 3D text from font-based rendering.
*/
import type { CrossSectionType } from '@manifold-studio/wrapper';
import { type TextRenderOptions } from './text-renderer.js';
/**
* Font loader function that returns a text rendering function
*
* @param fontName - Name of the font to use
* @returns Function that converts text to CrossSection
*/
export declare function fontLoader(fontName: string): (text: string, options?: TextRenderOptions) => CrossSectionType;
/**
* Register a custom font for use with fontLoader
*
* @param name - Display name for the font
* @param url - URL to load the font from
* @param options - Additional font metadata
*/
export declare function registerFont(name: string, url: string, options?: {
family?: string;
weight?: string;
style?: string;
fallbackUrls?: string[];
}): void;
/**
* Font management API
*/
export declare const fonts: {
/**
* Initialize fonts by loading all default and registered custom fonts
*/
initialize(): Promise<void>;
/**
* Ensure fonts are ready (same as initialize - idempotent)
*/
ensureReady(): Promise<void>;
/**
* Check if fonts have been initialized
*/
isReady(): boolean;
/**
* Get list of available font names
*/
list(): string[];
/**
* Check if a specific font is loaded
*/
isFontLoaded(name: string): boolean;
/**
* Get registry status for debugging
*/
getStatus(): {
isReady: boolean;
loadedFonts: string[];
availableFonts: string[];
customFonts: string[];
};
/**
* Reset font registry (for testing)
*/
reset(): void;
};
//# sourceMappingURL=font-loader.d.ts.map