Skip to content

fix: correct PDF link bounds and whitespace rendering#43

Open
DemchaAV wants to merge 1 commit into
developfrom
1.6.3
Open

fix: correct PDF link bounds and whitespace rendering#43
DemchaAV wants to merge 1 commit into
developfrom
1.6.3

Conversation

@DemchaAV
Copy link
Copy Markdown
Owner

Summary

Patch release for CV PDF rendering correctness.

Changes:

  • fixed paragraph link hit areas so they hug rendered text instead of the full fragment box
  • preserved author-supplied whitespace in PDF text rendering
  • improved Boxed Sections project layout with title/tech stack + indented description

No public API changes.

Testing

  • added regression tests for PDF link rectangles
  • updated sanitizer expectation for the new whitespace behavior
  • refreshed visual and layout baselines for intentional rendering changes

Three independent rendering defects surfaced on the CV gallery presets
when comparing the rendered PDFs to authors' intent.

Engine
- PdfFixedLayoutBackend now emits paragraph-level link annotations as
  per-line rects tight to the rendered text (alignment-aware lineX +
  line.width()) instead of the full fragment box. Right-aligned
  contact rows (Timeline Minimal / Sidebar Portrait / Monogram
  Sidebar) no longer hijack each other's clicks across the empty
  alignment gap.
- PdfFont.textSanitizer no longer collapses adjacent author spaces.
  The previous collapse shrank multi-space tokens at render while
  measurement kept the original width, drifting span-level link
  rectangles ~8pt per "   |   " separator (visible on Boxed Sections
  / Centered Headline) and visually merging spaced-caps titles like
  spacedUpper("ARTEM DEMCHYSHYN") back into a single run. Newlines /
  NBSP / control chars still resolve to a single space each.

Templates
- BoxedSections Projects render each item as two stacked paragraphs:
  bullet + bold project name (with optional "(tech stack)" chunk) on
  the first line, hanging-indented description below. Honours both
  BulletListBlock and IndentedBlock data shapes. Example data and the
  visual gallery test ship tech-stack chunks so the resulting CVs
  reflect the canonical layout.

Tests
- New regressions in PdfFixedLayoutBackendFeaturesTest and
  PdfFontSanitizerTest pin tight link rects on right-/center-aligned
  contact rows and the preserved-whitespace contract.
- Layout snapshot baselines for five CV presets and the nested-list
  document widened to reflect the recovered whitespace.
- Visual baseline PNGs for six CV presets refreshed for the two-line
  Projects layout and the wider spaced-caps headlines.
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