Commit Graph
9 Commits
Author SHA1 Message Date
ldm0 4b34263557 fix(pdf): avoid duplicate color glyph painting 2026-10-28 05:30:13 +08:00
ldm0 832252e610 fix(pdf): preserve SVG fallback paint per glyph 2026-10-28 05:30:13 +08:00
ldm0 22988c042e fix(pdf): share glyph ink measurement through AnyRender 2026-10-28 05:30:13 +08:00
ldm0 b8c6e1b9fd fix(paint): use CSS pixels for synthetic glyph weight 2026-10-28 05:30:13 +08:00
ldm0 7ffaa4ac1c fix(pdf): retain stroked degenerate glyph outlines 2026-10-26 19:26:49 +08:00
ldm0 199f2bc3fe fix(pdf): preserve color glyph ink in filter rasters 2026-10-26 19:26:49 +08:00
ldm0 2ce9dee328 refactor(pdf): share glyph geometry for text ink bounds
Resolve font metrics and text paint together for native PDF culling and
filter raster allocation, following SkPDFStrike and SkStrokeRec. Replace
the unconditional origin/em guard for outline glyphs with measured bounds.

Align static TrueType bounds with the rendered side bearing and retain
conservative fallback for missing outlines. Empty glyphs do not expand
raster allocations; native advance boxes preserve whitespace semantics.

Add coverage for negative side bearings, variable/CJK fonts, skew, and
empty runs. The 20px/8px probe shrinks from 224x224 to 96x104 raster pixels
while retaining reference ink coverage and searchable text.
2026-10-26 19:26:49 +08:00
ldm0 4fea7994ad fix(paint): align text stroke joins with Chromium
Use explicit miter joins and a shared miter limit of 4 for CPU and PDF
text strokes. Use the same conservative expansion for layout outsets
and native PDF clipping, including synthetic bold stroke widening.

Add deterministic triangle glyphs to cover pointed joins, bevel fallback,
and miter-only ink entering a PDF clip.
2026-10-26 19:26:49 +08:00
ldm0 53d16780d5 feat(pdf): render searchable PDFs with Krilla
Route CDP Page.printToPDF and CLI PDF dumps through an owned snapshot PDF
backend with embedded subset fonts and logical text cluster mappings.

Preserve print layout isolation, page selection, and bounded local raster
fallbacks. Pin Krilla to upstream Git and share its font parsing dependencies
with the existing rendering stack where version constraints allow.

Add PDF extraction, pagination, graphics, and print lifecycle regressions,
fixed font fixtures, and reader and CDP smoke checks.

Refs #279.
2026-10-12 21:33:26 +08:00