/** * The `@font-face` rules a subject is set in. * * Applicability pruning keeps the rules that match an element, and a face * matches none: it names a file, and the element names the face. Pruned with * the rest, it left a render document whose `font-family` asked for a face * nobody declared — which every renderer answers with whatever it has * installed. So a page that ships its own font was painted in the fallback, and * a change to that font moved no image. * * A face is carried when a family it declares is in the computed `font-family` * of something the subtree paints, generated boxes of its frame included * (`paintedStyles`), which is the pruning question asked of the one * rule that cannot be asked it directly. Its files are named against the page, * not against the sheet that declared them, because the render document has one * inline sheet and a base: `url(../fonts/a.woff2)` written in * `/assets/site.css` resolves against the page there, and fetches nothing. */ export interface IndexedFace { /** The family the face answers for, folded the way family names match. */ readonly family: string; /** The rule as the render document carries it, every `url()` against the page. */ readonly text: string; /** Every file the face names, absolute. */ readonly sources: readonly string[]; /** * Whether the host kept the face's `src`. * * jsdom's CSSOM keeps `font-family` on a face and nothing else, so a face read * there declares a family and no file. Carrying it would paint the fallback * under a declaration that says otherwise. */ readonly readable: boolean; } export declare function isFontFaceRule(rule: CSSRule): rule is CSSFontFaceRule; /** * One face, read from the sheet it sits in. * * `base` is what the sheet's own relative URLs resolve against: its `href`, or * the document's base for a sheet with none. */ export declare function faceOf(rule: CSSFontFaceRule, base: string, document: Document): IndexedFace | null; /** The faces a subtree is set in, in the order the document declared them. */ export declare function facesUsedBy(root: Element, faces: readonly IndexedFace[]): readonly IndexedFace[]; /** * Every family named in the computed `font-family` of these styles. * * The whole stack, not the face that won: which entry a glyph is drawn from is * the renderer's to decide from the faces it holds, and a face left out because * an earlier entry was installed here is a face missing wherever it is not. */ export declare function familiesPaintedWith(styles: readonly CSSStyleDeclaration[]): ReadonlySet; //# sourceMappingURL=font-faces.d.ts.map