/** * What Google publishes, and which of it an app asked for. Pure: no network, no * disk — building the request URL, reading the answer, and filtering it down. * * The CSS2 API already ships one pre-subset `woff2` per unicode range, which is * why Janux does no glyph-level subsetting of its own: declaring `subsets` is a * filter over what Google already split up. */ import type { FontConfig } from 'janux'; /** One `@font-face` as Google published it, before it is self-hosted. */ export interface GoogleFace { subset: string; weight: number; style: string; url: string; unicodeRange: string; preload: boolean; } export declare const DEFAULT_WEIGHTS: number[]; export declare const DEFAULT_STYLES: string[]; export declare const DEFAULT_SUBSETS: string[]; export declare function googleCssUrl(config: FontConfig): string; /** Google labels each block with its subset in a comment — the only place that name appears. */ export declare function parseGoogleCss(css: string): GoogleFace[]; /** The file metrics are measured from, and the one worth preloading: primary subset, lightest upright weight. */ export declare function primaryFace(faces: GoogleFace[], config: FontConfig): GoogleFace; /** * Exactly what was declared, with one face marked critical. The request already * asks for these weights, but trusting the answer to match is how a page ships a * weight nobody uses — and a preload for every subset the family covers pushes * the file that is needed behind the ones that are not. */ export declare function selectFaces(faces: GoogleFace[], config: FontConfig): GoogleFace[]; /** A font that resolved to no faces at all is a typo, not a page that should ship without it. */ export declare function nothingSelected(config: FontConfig): string;