Skip to content

fix(signature): render typed signature on one line at the largest size that fits - #9551

Open
no84by wants to merge 1 commit into
LibreSign:mainfrom
no84by:fix/text-signature-size
Open

no84by wants to merge 1 commit into
LibreSign:mainfrom
no84by:fix/text-signature-size

Conversation

@no84by

@no84by no84by commented Nov 18, 2026 •

Copy link
Copy Markdown

Part of #9048 (signature appearance).

Summary

The typed signature was drawn at a fixed 30px, so short names looked small on the final document. It is now drawn on one line at the largest size that fits the canvas width minus a 6px margin per side, capped at 80% of the canvas height. Long names whose fitted size would fall below 30px keep the current wrapping at 30px. The sizing is a pure helper with unit tests.

Measured with summed Dancing Script advance widths (no kerning), default 350x100 canvas:

Name Before After
Short ("Jo Li") 30px 80px, one line
Long (49 chars) 30px, wrapped 30px, wrapped (unchanged)

At 700x200 the same long name is 35.6px on one line and the short name 160px.

How to test

Open the typed signature dialog. A short name fills most of the canvas height; a long name keeps wrapping as before.

Validation evidence

New helper spec and TextInput.spec.ts pass (32 tests); eslint clean on the changed files.

  • Focused regression/acceptance test (helper spec, TextInput.spec.ts)
  • Relevant lint/type/static-analysis checks (eslint)
  • CI reviewed

UI / Front-end changes

  • Typed signature drawn larger on one line; long names keep wrapping
  • Screenshots before/after added for user-visible changes
  • Component/unit (Vitest) tests added or updated

Checklist

  • I have read and followed the contribution guide.
  • The diff does not contain unrelated refactors or generated changes.
  • Commits follow Conventional Commits where applicable.
  • All commits include the required DCO sign-off.

AI (if applicable)

  • The content of this PR was partially or fully generated using AI

…e that fits

The typed signature used a fixed 30px font, leaving short names small on the final document. Draw it on a single line, sized to the canvas width minus a small margin and capped at 80% of the canvas height. When the fitted size would fall below the current 30px, keep the existing word-wrapping at 30px.

Signed-off-by: no84by <50858621+no84by@users.noreply.github.com>
@no84by

no84by commented Nov 18, 2026

Copy link
Copy Markdown
Author

Screenshots (test instance on main 7a8403d vs this branch, light and dark theme):

Text tab, short name

Before (light) After (light)
before after
Before (dark) After (dark)
before after

Text tab, long name (keeps the existing wrapping)

Before (light) After (light)
before after
Before (dark) After (dark)
before after

Text tab, medium name

Before (light) After (light)
before after
Before (dark) After (dark)
before after

The script font did not load on the test instance, so both versions render in a serif fallback; the size difference is what this PR changes.

This branch has not been deployed

No deployments
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