import { PdfDict } from '../pdf/objects.js'; import { PdfFile, PdfPage } from './document.js'; import { Loss } from '../core/ir/index.js'; import { FontRegistry } from '../core/font/index.js'; /** * Every embedded TrueType program the pages use, by the name a run will ask for * — the `/BaseFont` lowercased, with the subset prefix dropped. * * Each PDF font object becomes its OWN entry rather than being folded into a * family: `Arial-BoldMT` is a different program from `ArialMT` and the run that * uses it names it exactly, so nothing has to guess at weights or match faces * up. A face the reader cannot parse is left out and the writer substitutes for * it as before. * * Only `/FontFile2` is read. A CFF program (`/FontFile3`) and a Type 1 one * (`/FontFile`) are different formats that the layout's parser does not take; * those keep their substitute. * * And only one whose OUTLINES this pipeline can carry: a program with no * `glyf`/`loca` cannot be subset, and a face offered here is one the writer * will be asked to embed. bug1186827.pdf ships an OpenType/CFF program under * `/FontFile2`, which parses like any other and then killed the whole * conversion — "Subsetting requires a TrueType font with glyf+loca tables" — * rather than losing one face. * * @param file The owning file. * @param pages The pages whose fonts are wanted. * @param losses Appended to for a face the page embeds and this cannot carry. * @returns Name → a one-face registry holding that program. */ export declare function collectEmbeddedFonts(file: PdfFile, pages: ReadonlyArray, losses?: Array): Map; /** * The name a run set in `fontDict` will ask for: its `/BaseFont` without the * six-capital subset prefix (§9.6.4), lowercased. * * @param file The owning file. * @param fontDict A `/Font` dictionary. * @returns The name, or `undefined` when the font states none. */ export declare function embeddedFontName(file: PdfFile, fontDict: PdfDict): string | undefined; /** * Whether this font carries a program this pipeline can set the page in. * * Only `/FontFile2` is liftable, and a run in such a face is filed under the * face's own name — so that name must be left exactly as it is. Every other * face is SUBSTITUTED, and its name is free to say what it is. * * @param file The document. * @param fontDict The font dictionary. */ export declare function hasLiftableProgram(file: PdfFile, fontDict: PdfDict): boolean;