Skip to content

💥 Use font vertical metrics for line height#106

Merged
ralfstx merged 1 commit intomainfrom
line-height
Feb 28, 2026
Merged

💥 Use font vertical metrics for line height#106
ralfstx merged 1 commit intomainfrom
line-height

Conversation

@ralfstx
Copy link
Copy Markdown
Member

@ralfstx ralfstx commented Feb 28, 2026

The line height calculation used a hardcoded 1.2× multiplier on top of ascent/descent, ignoring the font's own sTypoLineGap. This produced spacing that didn't respect font design intent.

Include lineGap in the text height calculation and change the default lineHeight multiplier from 1.2 to 1. Line spacing now follows the font's vertical metrics directly. The previous behavior can be restored by adjusting the lineHeight property (e.g., lineHeight: 1.2).

The line height calculation used a hardcoded 1.2× multiplier on top of
ascent/descent, ignoring the font's own `sTypoLineGap`. This produced
spacing that didn't respect font design intent.

Include `lineGap` in the text height calculation and change the default
`lineHeight` multiplier from `1.2` to `1`. Line spacing now follows the
font's vertical metrics directly. The previous behavior can be restored
by adjusting the `lineHeight` property (e.g., `lineHeight: 1.2`).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ralfstx ralfstx merged commit ec6bb7c into main Feb 28, 2026
1 check passed
@ralfstx ralfstx deleted the line-height branch February 28, 2026 17:25
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