import type * as Template from '../serial/serial-types.js'; /** * Make provided font bytes available to text MEASUREMENT before conversion runs, * and attach the matching `@font-face` document to each serial for the RENDERER. * * The point is atomicity: bluepic-core measures text against whatever font set is * registered in the ambient canvas registry — `document.fonts` in the browser, * skia's `FontLibrary` under headless. If a font isn't there yet, measureText * silently returns FALLBACK metrics and the converter bakes wrong geometry. So we * register the bytes into that SAME registry and AWAIT real availability first. * * The serial `Template.Font.src` is a CSS document built by the ONE shared builder * ({@link buildBluepicFontCSSDocument}) whose `@font-face` `src`s are self-contained * `data:` URLs — the SAME document a persisting consumer uploads to the font cloud, * so the preview and the upload can never disagree. (Browser: the document is served * over a session `blob:` URL to keep the serial JSON small; Node: a `data:text/css` * URL so it's fully portable.) */ export type LoadableFace = { weight: number; italic: boolean; bytes: ArrayBuffer; fileName?: string; }; export type LoadableFont = { family: string; faces: LoadableFace[]; }; /** * Register `fonts` into the ambient measurement registry and await availability. * No-op for an empty list. Returns the serial `Template.Font[]` to attach. */ export declare function loadFontsForMeasurement(fonts: LoadableFont[]): Promise; //# sourceMappingURL=fontLoading.d.ts.map