import type { SvgFontProvider, SvgFontStyle, SvgFontSyncProvider } from './fonts.js'; export interface RegisterFontOptions { /** CSS `unicode-range` of the file (`U+0000-00FF, U+0131`): a slice of a * family served as several files is handed out only for text that * needs it. Absent: the file covers every character. */ unicodeRange?: string; } /** Parse a CSS `unicode-range` into code point intervals; null when it * reads as nothing. */ export declare function parseUnicodeRange(value: string | undefined): [number, number][] | null; /** Register the bytes of a face (TrueType, OpenType, WOFF or WOFF2) for * SVG pictures to embed. `weight` is a number or a variable range * (`'100 900'`). Registering the same face again replaces it. */ export declare function registerFontBytes(family: string, weight: number | string, style: SvgFontStyle | string, bytes: Uint8Array | ArrayBuffer, options?: RegisterFontOptions): void; /** Register a face by the URL of its file, fetched the first time an SVG * needs it (a slice only when the SVG sets characters in its * `unicodeRange`). */ export declare function registerFontUrl(family: string, weight: number | string, style: SvgFontStyle | string, url: string, options?: RegisterFontOptions): void; /** Forget every registered face of a family. */ export declare function unregisterFontFamily(family: string): void; /** Forget every registered face. */ export declare function clearRegisteredFonts(): void; /** A counter bumped by every registration change: hosts that cache * SVG markup with fonts inlined key it with this. */ export declare function registeredFontGeneration(): number; export interface RegisteredFontProviderOptions { /** Also read the `@font-face` rules of the page's style sheets for a * family nothing registered. Default true (in a browser). */ styleSheets?: boolean; /** The `fetch` used for URL faces. Default the global one. */ fetch?: typeof fetch; } /** An `inlineSvgFonts` provider over the registered faces * ({@link registerFontBytes}, {@link registerFontUrl}), then the page's * `@font-face` rules: the cut nearest to the weight asked for, the same * style first, and of a family served as unicode-range slices only the * files that hold the characters. */ export declare function registeredFontProvider(options?: RegisteredFontProviderOptions): SvgFontProvider; /** The registry's faces held in memory: registered bytes, and URL faces * once fetched. For synchronous hosts (`renderToHtml`). */ export declare function registeredFontSyncProvider(): SvgFontSyncProvider; /** A registered file, with the descriptors a `FontFace` takes. */ export interface RegisteredFontFile { family: string; /** `'400'`, or a variable range `'100 900'`. */ weight: string; style: SvgFontStyle; /** The file's `unicode-range`, when it is a slice. */ unicodeRange?: string; bytes: Uint8Array; } /** * The files of a face the registry holds (#629): the cut nearest to * (weight, style), and of a family served as slices only the slices that * hold `codePoints` (all of them when absent), each with its descriptors — * what a layout worker needs to declare the face (`registerFonts`). URL * faces are fetched; with `styleSheets`, a family nothing registered is * read from the page's `@font-face` rules, as {@link registeredFontProvider} * does. Files that cannot be had are left out. */ export declare function registeredFontFiles(family: string, weight: number, style: SvgFontStyle, options?: { codePoints?: ReadonlySet; styleSheets?: boolean; fetch?: typeof fetch; }): Promise; //# sourceMappingURL=fontRegistry.d.ts.map