Skip to main content
The low-level pipeline under toPdf: bytes in, a LayoutDocument with one page per slide out, then PDF. See .pptx to PDF.

runPptxPipeline()

Import from @reductoai/pptx, @reductoai/pptx/browser.

PptxPipelineOptions

Import from @reductoai/pptx, @reductoai/pptx/browser.

slideSizeHmm()

Slide size in hmm, for callers that need the page box without the pages. Import from @reductoai/pptx, @reductoai/pptx/browser.

renderPdfBytes()

Build the PDF for a fully laid ir; createPdfWriter is the page-at-a-time form. Import from @reductoai/pptx/pdf.

FontRegistry

Owns one document’s font state (builtins, overlay, fontTable decls). Import from @reductoai/pptx, @reductoai/pptx/browser.

FontRegistry properties

ansiOnly()

applyEmbeddedFonts()

Overlay a document’s embedded faces onto the registry, replacing any previous document’s. Must be called once per document before measuring and again before rendering. Registrations do not carry over between documents. A partially-embedded family keeps the builtin faces of the family the name would otherwise resolve to, so a doc that embeds only the bold face still measures its regular runs with the substitute.

applyFontDeclarations()

Install a document’s fontTable declarations, replacing any previous document’s. Same per-document contract as applyEmbeddedFonts.

builtinCjkFamilies()

Family names marked CJK-capable, for a host mirroring this registry: without replaying them through markCjkFamilies, resolveCjkFamily would rewrite every eastAsia name to Arial Unicode MS.

builtinFamilyIds()

cjkFaceId()

The id of the regular CJK face, when registered (dedupes / CJK metrics).

documentScope()

This registry’s installed faces under one document’s own fontTable and embedded faces.

familySet()

The registered faces of a canonical family (document overlay first). Every read path goes through here — resolveFace, cjkFaceId, the measurer’s and painter’s Times fallback — which is why the face trace is recorded at this one point. All four slots of a touched family are recorded, not just the requested one: cheap, and it keeps bold/italic switching within a family from needing a third pass.

hasFamily()

True when family (lowercased) has faces, without recording a lookup or a fallback.

installedTable()

Installed families and CJK marks, for an engine that replays the table (wasmFontManifest).

isCjkFace()

True when a face file belongs to a CJK family, so a painter’s baseline uses the same Word CJK box the measurer charged (isCjkFamily), not hhea + gap.

isCjkFamily()

True when the resolved face uses CJK line metrics.

isCjkFontRequest()

isEmbeddedOnly()

True when family (lowercased) has faces only because the document embeds them.

isRegisteredFontFile()

True when id names a face this registry can hand out (builtin or the current document’s overlay). For node system fonts the id is the file path, so this remains a path allow-list for the demo server.

markCjkFamilies()

Mark registered families as CJK-capable. Word bundles the real face (KaiTi, SimSun, …); without this, resolveCjkFamily would still fall through to Arial Unicode MS for every eastAsia name.

markNoSubsetFaces()

Mark face source ids that must be embedded whole: faces fontkit’s subsetter corrupts (empty outlines, invalid tables). The PDF backend unions these into its per-document no-subset set.

noteScriptFace()

A script the requested face cannot draw paints in served, a portable face.

quietly()

Runs fn noting no swap: a face probed for glyphs is not one the document asked for.

recordFallbacks()

Collect every swap noted while fn runs. A layout memo stores the list and feeds it back through replayFallbacks when it skips the work, so the per-document ledger reads the same whether or not the memo hit.

registerBuiltinFamilies()

Install (or replace) builtin families. Called by environment adapters.

registeredFaceBytes()

The bytes of a registered face by id, or null. Used by the demo server to serve /api/font from the registry instead of trusting client paths.

replayFallbacks()

Replays verbatim, so a sink’s length still counts what it was fed.

resolveArabicFamily()

resolveCjkFamily()

resolveDevanagariFamily()

Resolve unsupported Devanagari through the portable face or Word’s Mangal.

resolveFace()

Resolve a requested family name to { family, key, source } preserving bold/italic. source is absent when the resolved family has no registered face for that slot (nothing installed, or a partial embed edge case); consumers fall back (measurer -> Times -> width heuristic, painter -> Times).

resolveFamily()

Map a requested family name to a canonical registered family key.

resolveHebrewFamily()

Portable-only Hebrew counterpart to resolveArabicFamily.

resolveThaiFamily()

Word falls unsupported Thai complex-script text through to Tahoma.

startFaceTrace()

Start recording the ids of every face this registry hands out. A browser host needs this because FaceSource.bytes() is SYNCHRONOUS while fetching is not: it cannot load a face on demand mid-layout. So it installs the whole family table with empty faces, lays out once under a trace to learn which faces the document actually reaches, fetches exactly those, and lays out again. Pass two asks for the same set — resolution depends on the family table and the document, never on whether bytes were present — so the second pass is the real one.

takeFaceTrace()

Ids recorded since startFaceTrace, and stop recording.

defaultFontRegistry

Default instance used by the CLIs and the demo. Import from @reductoai/pptx, @reductoai/pptx/browser.

blankPresentationBytes()

The bytes PowerPointPresentation.create() starts from, without the parser: for a server that only stores them. Import from @reductoai/pptx/blank.