Skip to content

feat: typography controls and styling reset in the document tab#114

Merged
rimzzlabs merged 1 commit into
mainfrom
feat/typography-settings
Jul 18, 2026
Merged

feat: typography controls and styling reset in the document tab#114
rimzzlabs merged 1 commit into
mainfrom
feat/typography-settings

Conversation

@rimzzlabs

Copy link
Copy Markdown
Owner

Adds line height and letter spacing controls to the Document tab, makes section spacing bidirectional to match, and adds a one-tap reset for all document styling. Every slider rests at the document's true current value and moves both ways, so tightening is as much a first-class action as loosening.

  • Line height (1.2 to 2.0) rests at the open template's actual baseline, 1.4 for most templates and 1.45 for Klasik and Luasa, from a new TEMPLATE_LINE_HEIGHT map that mirrors each PDF page style. Fixing the slider's resting position also fixed a real parity gap: the preview body rendered 1.625 leading while the PDF used 1.4/1.45, so on-screen rhythm and export never quite matched. The preview body now follows the template baseline; the exported PDF is unchanged.
  • Letter spacing spans -0.5 to +0.5. The bounds come from measured extraction behavior: react-pdf places letter-spaced glyphs individually, and outside that range at the 8-9pt body sizes text extractors stop recovering word boundaries, splitting words when too wide ("Cor p") and merging them when too tight. Every shippable value was verified to extract intact, and the bounds are enforced three times over: slider, interchange validation, and a view-model clamp, so even a hand-edited YAML cannot break ATS parsing.
  • Section spacing now runs -24 to +60. The floor cancels the 24-unit baseline gap above headings exactly, so sections can sit flush but never overlap; entry spacing inside sections is untouched either way.
  • The Document styling section header gains a reset button that restores icons, font, section spacing, line height, and letter spacing to their defaults in one write. It disables itself while everything is already pristine. Document language is deliberately excluded, since it relabels content rather than styling.
  • Schema: letterSpacing and lineHeight on the document with CURRENT_SCHEMA_VERSION bumped to 19 and a bail-safe rung (letter spacing stamped to 0, absent line height meaning template default). JSON and YAML interchange round-trips both with the same bounds.

Testing: a fresh resume's preview body measures exactly the template's 1.4 baseline; tightening both typography sliders to their minimums compacts the page visibly, persists a reload, and reads back in the controls; the tightest possible PDF still extracts every word whole and in linear reading order, as does the widest. Section spacing at -24 renders headings flush with the previous section while entry gaps hold, and +60 still paginates correctly. The reset button starts disabled, enables after any change, restores every control and the preview in one click, disables again, and the reset state survives a reload. Documents saved at schema versions 16 and 18 open at their baselines with all controls at rest and no errors.

Signed-off-by: Rizki Citra <rimzzlabs@proton.me>
@rimzzlabs
rimzzlabs merged commit 0cebf8f into main Jul 18, 2026
4 checks passed
@rimzzlabs
rimzzlabs deleted the feat/typography-settings branch July 18, 2026 04:39
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