Interface for pluggable font sources.
A font provider resolves a font name into binary font data. Implement this interface to load fonts from any source — a self-hosted CDN, a local server, or any custom storage.
TVG.Font.provider({ fetch: async (name) => { const res = await fetch(`/my-fonts/${name}.ttf`); return { data: new Uint8Array(await res.arrayBuffer()), type: 'ttf' }; }});await TVG.Font.load('my-font'); Copy
TVG.Font.provider({ fetch: async (name) => { const res = await fetch(`/my-fonts/${name}.ttf`); return { data: new Uint8Array(await res.arrayBuffer()), type: 'ttf' }; }});await TVG.Font.load('my-font');
Fetch font data by name.
Font name as provided by the caller
Optional
Provider-specific options
Font binary data and format
Interface for pluggable font sources.
A font provider resolves a font name into binary font data. Implement this interface to load fonts from any source — a self-hosted CDN, a local server, or any custom storage.
Example