You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PDF: text colour, strongly-typed render mode, image clip fix (#571)
* font: drop out-of-range glyph ids when re-encoding to PUA
`glyph_for_code` can fall back to "code as GID" (ISO 32000-1 9.6.6.4) and
yield an index past `numGlyphs`. A single cmap entry referencing such a
glyph makes the OTS sanitizer reject the *entire* font, so every glyph
renders as a tofu box rather than just the unmappable code. Skip those
entries in both the CFF (`wrap_to_otf`) and SFNT (`reencode_to_pua`)
paths, with tests covering the drop.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* PDF: text colour, strongly-typed render mode, image clip fix
- Carry the non-stroking (fill) and stroking device colours on each
TextElement and paint runs in their colour (interned `.k` class) when
it is not the default black — fill modes use the fill colour, the
stroke-only modes (Tr 1/5) the stroking colour. The colour rides the
visible layer in the dual-layer (PUA glyph) cases.
- Replace the bare `int rendering_mode` with a strongly-typed
`TextRenderingMode` enum (ISO 32000-1 Table 106) across the graphics
state, page element and renderer, removing the magic 0/1/3/5/7
comparisons.
- Wrap clipped `<image>` elements in a transform-free `<g clip-path>`:
a clip-path on the image itself resolves in the image's post-transform
unit-square space and clips the whole image away.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments