Skip to content

fix(pdf): debug overlay hardening - neutral DocumentDebugOptions + top-most label post-pass#165

Merged
DemchaAV merged 3 commits into
developfrom
fix/debug-overlay-hardening
Jun 11, 2026
Merged

fix(pdf): debug overlay hardening - neutral DocumentDebugOptions + top-most label post-pass#165
DemchaAV merged 3 commits into
developfrom
fix/debug-overlay-hardening

Conversation

@DemchaAV

Copy link
Copy Markdown
Owner

What

Review follow-ups on the v1.8 debug overlay (#163), findings 3–8 of the post-merge review:

  • PdfDebugOptionsDocumentDebugOptions in document.output, following the neutral-output-options pattern (DocumentWatermark, DocumentMetadata, …) — future fixed-layout backends reuse the same carrier instead of growing per-format duplicates. Unreleased API, so the rename is free (japicmp baseline is v1.7.0).
  • Labels paint as one deterministic post-pass over the owner-bounds map after all content: badges can no longer be overdrawn by a container's children or a higher layer; the per-fragment dedup set, its path#page key churn, and the widened render signatures are gone; iteration is page/path-sorted for byte-stable output.
  • Badge font per render pass (the watermark/header-footer pattern) — kills the shared static PDType1Font whose PDFBox encode cache is not safe under the documented concurrent-render contract.
  • Label text degrades via the shared GlyphFallbackLogger — WinAnsi accents like é survive, anything else becomes ? with a glyph.missing log (previously hand-rolled ASCII mangled é//©).
  • Badge clamped to the page box — a FULL_PATH label on a narrow right-edge node no longer draws off-page.
  • GraphCompose.DocumentBuilder drops its boolean+options field pair for one DocumentDebugOptions field: guideLines()/debug() follow last-write-wins on all three surfaces and debug(none()) reliably disables everything (previously the builder OR-merged and could not turn guides off).
  • Corner-badge prose corrected in Javadoc / example / CHANGELOG (said "top-left", shipped geometry is top-right straddling the edge).

Verification

  • Overlay suite now 17 tests: new é-survival, builder last-write-wins (both call orders), and split-owner-labelled-on-every-page cases; existing extraction/byte-identity/visual tests green.
  • Regenerated assets/readme/examples/debug-overlay.pdf; text-extraction order independently confirms the post-pass (all labels extract after content).
  • Full gate: ./mvnw verify -pl .1243 tests, 0 failures, BUILD SUCCESS.

DemchaAV added 3 commits June 12, 2026 00:49
…-most label post-pass

Review follow-ups on the v1.8 debug overlay: (1) PdfDebugOptions moves to the backend-neutral document.output as DocumentDebugOptions, following the established neutral-output-options pattern so future fixed-layout backends reuse it; (2) node labels paint as one deterministic post-pass over the owner-bounds map after all content - badges can no longer be overdrawn by children or higher layers, the per-fragment dedup set and its key churn are gone, and the badge font is constructed per render pass (the watermark/header-footer pattern) eliminating the shared static PDType1Font race; (3) label text degrades through the shared GlyphFallbackLogger so WinAnsi accents like e-acute survive; (4) badge X is clamped to the page box; (5) GraphCompose.DocumentBuilder drops its boolean+options field pair for one DocumentDebugOptions field - guideLines()/debug() now follow last-write-wins on all three surfaces and debug(none()) reliably disables everything; (6) corner-badge prose corrected in Javadoc/example/CHANGELOG. 17 tests across the overlay suite incl. new e-acute survival, builder-semantics, and split-owner-per-page cases.
@DemchaAV DemchaAV merged commit 5aa754a into develop Jun 11, 2026
11 checks passed
@DemchaAV DemchaAV deleted the fix/debug-overlay-hardening branch June 11, 2026 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant