/** * Single source of truth for turning font binaries into a Bluepic `@font-face` * CSS document. * * The SAME builder produces (a) the CSS the conversion preview renders from and * (b) the CSS uploaded to the Bluepic font cloud — so the two can never drift. * Each `src` is a self-contained `data:` URL (NOT a session `blob:`), so the * document is immediately upload-ready and survives a reload. * * Descriptors (weight / style / stretch) are read from the font BINARY via * fontkit — the font's own OS/2 / fvar / head tables — not guessed from file * names, so a family's weights are described exactly as the browser will resolve * them. (Ported from bx-studio's `makeCSSFontFileV2`, kept identical in output.) */ /** A font binary to include, plus its file name (used for the `format()` hint). */ export type FontFileSource = { bytes: ArrayBuffer; fileName?: string; }; /** One resolved `@font-face`, with the bytes so a caller can also register it for measurement. */ export type BuiltFontFace = { family: string; /** `font-weight` token: a single class (`"400"`) or a variable range (`"100 900"`). */ weight: string; /** `font-style` token: `normal` | `italic` | `oblique`. */ style: string; /** `font-stretch` token: keyword, or a variable range (`"75% 125%"`). */ stretch: string; type: 'variable' | 'static'; mime: string; bytes: ArrayBuffer; }; export type BuiltFontCSS = { /** The `@font-face` document — data-URL `src`s, ready to render AND to upload. */ css: string; /** The CSS `font-family` used (the override if given, else the binaries' own name). */ family: string; weights: string[]; styles: string[]; type: 'variable' | 'static'; /** The deduped, ordered faces (bytes included) — for canvas/skia measurement registration. */ faces: BuiltFontFace[]; }; /** * Build the Bluepic `@font-face` document for one family from its binaries. * * @param sources one or more font binaries (all of the same family) * @param opts.family CSS `font-family` to emit (defaults to the binaries' own name) * @param opts.strictFamily throw if the binaries declare different internal families * (bx-studio's manual multi-file upload wants this; the converter, which * pre-selects a family's files, leaves it off). Default `false`. * @throws if a file can't be parsed / is a collection, or (strict) families disagree. */ export declare function buildBluepicFontCSSDocument(sources: FontFileSource[], opts?: { family?: string; strictFamily?: boolean; }): Promise; //# sourceMappingURL=fontCss.d.ts.map