/** One `@font-face` rule. A real face carries `src` (woff2 files); a generated * fallback face carries `local` + the size-adjust/override metrics instead. */ export interface FontFace { /** `font-family` — the real family, or `" Fallback"` for the * size-adjusted fallback face. */ family: string; /** outdir-relative woff2 filenames (real face). Empty for a fallback face. */ src: string[]; /** `local("...")` source for a size-adjusted fallback face, e.g. `"Arial"`. */ local?: string; weight?: string; style?: string; display?: string; unicodeRange?: string; /** `size-adjust` percentage (fallback face only), e.g. `"107.40%"`. */ sizeAdjust?: string; /** `ascent-override` percentage (fallback face only). */ ascentOverride?: string; /** `descent-override` percentage (fallback face only). */ descentOverride?: string; /** `line-gap-override` percentage (fallback face only). */ lineGapOverride?: string; } /** The bundle manifest's `fonts` block: structured faces + CSS variables + * the woff2 files to ``. Rendered into every SSR ``. */ export interface ManifestFonts { faces: FontFace[]; /** CSS custom property → font-family stack, e.g. * `{"--font-sans": '"Geist", "Geist Fallback", sans-serif'}`. */ variables: Record; /** outdir-relative woff2 filenames to preload. */ preload: string[]; } interface SfntMetrics { unitsPerEm: number; ascent: number; descent: number; lineGap: number; xAvgCharWidth: number; } /** A `ManifestFont` as it appears in `pylon.manifest.json` (snake_case wire * shape — see the SDK `font()` helper). */ interface ManifestFontInput { family: string; variable: string; weights?: string[]; styles?: string[]; subsets?: string[]; display?: string; preload?: boolean; fallback?: string[]; adjust_font_fallback?: boolean; } /** Decode the line-box metrics from a font buffer (woff2 or raw sfnt). Returns * null when the format/tables can't be read — callers degrade gracefully. */ export declare function decodeFontMetrics(buf: Uint8Array): SfntMetrics | null; /** Compute the size-adjusted fallback `@font-face` for a family. The web font's * metrics, divided by the size-adjust factor, become the overrides — so the * local fallback occupies the same line box + average advance as the web font * will, eliminating the swap-in shift. */ export declare function computeFallbackFace(metrics: SfntMetrics, family: string, category: "sans-serif" | "serif"): FontFace; /** Render the structured faces + `:root` variables into a CSS string. woff2 URLs * are resolved against `prefix` (the live `public_prefix`) so they match * wherever the assets are served (same-origin or CDN). */ export declare function renderFontFaceCss(fonts: ManifestFonts, prefix: string): string; interface FontSpec { family: string; weights: string[]; styles: string[]; subsets: string[]; display: string; } interface FaceBlock { subset: string; style: string; weight: string; unicodeRange: string; url: string; } /** Build the Google Fonts CSS2 API URL for a spec. */ export declare function buildGoogleFontsUrl(spec: FontSpec): string; /** Parse a Google Fonts CSS2 response into per-subset face blocks, keeping only * the requested subsets. Each `@font-face` is preceded by a subset comment in * the API output. */ export declare function parseGoogleFontsCss(css: string, subsets: string[]): FaceBlock[]; /** Build all declared fonts: fetch + self-host + metrics + structured faces. * Network/parse failures for a single family degrade to a variable-only entry * (so `var(--font-x)` still resolves to the fallback stack) rather than killing * the build. Returns null when nothing was produced. */ export declare function buildFonts(fs: any, path: any, cwd: string, outdir: string, fonts: ManifestFontInput[]): Promise; /** Read the `fonts` array from the app's `pylon.manifest.json` (written next to * app.ts). Returns [] when absent/unreadable. */ export declare function readManifestFonts(fs: any, path: any, cwd: string): ManifestFontInput[]; export {};