ComposeCanvas
PdfCanvas backed by a Compose Multiplatform DrawScope.
Three rendering paths:
Embedded outlines — when PdfFont.hasEmbeddedOutlines is true, each byte/CID becomes a Compose
Pathfilled at the right position.System-font fallback — when no outlines available, decode to text and hand to Compose's
TextMeasurer.Transparency groups — open a
saveLayeron the underlying Canvas when the renderer requests one; laterrestorecomposites the layer back with the requested blend mode + alpha.
Clipping uses Compose's clipPath inside a recursive scope; transparency groups use the lower-level Canvas.saveLayer so they can span multiple DrawScope operations.
Functions
Soft-mask compositing (ISO 32000-1 §11.6.5). We open a saveLayer for the content, render it, then over-paint the mask group with ComposeBlendMode.DstIn so the mask's alpha clips the content.
Transparency groups: open a Compose saveLayer on the active Canvas with a Paint that carries the requested alpha + blend mode. Subsequent draws accumulate into the offscreen layer; matching endTransparencyGroup calls restore, which composites the layer onto the parent.