/** * System font discovery for PDF generation. * * When no embedded font is provided and the document contains non-WinAnsi * characters, this module searches standard system font directories for a * TrueType font (.ttf or .ttc) with broad Unicode coverage. * * This is a Node.js-only feature — browser environments do not have * file system access and must always provide fonts explicitly. * * .ttc (TrueType Collection) files are supported — parseTtf() extracts * the first font from the collection automatically. * * Discovery is exposed both as a generator * ({@link iterateSystemFontCandidates}) for early-exit callers and as * an array snapshot ({@link discoverSystemFontCandidates}) for tests * and full enumeration. Once the full snapshot has been produced it is * cached and replayed on subsequent calls; partial iterations rely on * the OS page cache to make repeat reads of the same font files cheap. */ /** * Lazily yield discoverable system font candidates, in preference order. * * Each entry is the raw font file bytes of a `.ttf` or `.ttc` file. * The caller decides which candidate to use (e.g. by checking cmap coverage). * * Iterating one candidate at a time lets callers `break` as soon as * they find a match, avoiding the cost of recursively reading every * font in every system font directory just to discard them. */ export declare function iterateSystemFontCandidates(): Generator; /** * Return all discoverable system font candidates, ordered by preference. * * Each entry is the raw font file bytes of a `.ttf` or `.ttc` file. * The caller decides which candidate to use (e.g. by checking cmap coverage). * * The full snapshot is cached: once produced, repeated calls return the * same array without touching the filesystem. * * Prefer {@link iterateSystemFontCandidates} when you only need the * first candidate that satisfies a predicate: it avoids reading every * font in every system directory just to discard them. */ export declare function discoverSystemFontCandidates(): Uint8Array[]; /** * Search for a system font suitable for Unicode rendering. * * Returns the raw font file bytes of the highest-priority candidate, * or `null` if no font was found. */ export declare function discoverSystemFont(): Uint8Array | null; /** * Reset the cached font discovery result (for testing). */ export declare function resetFontDiscoveryCache(): void; /** * Override the cached candidates with a custom list (for testing). * Call {@link resetFontDiscoveryCache} to clear the override. */ export declare function _setCandidatesForTest(candidates: Uint8Array[]): void;