Skip to content

Conversation

@oznogon
Copy link
Contributor

@oznogon oznogon commented Jul 24, 2025

To ensure that Font::PreparedFontString::getUsedAreaSize() returns an accurate value without changing glyph positions or line heights, track descenders using the delta between the glyph's height and its horiBearingY metric.

See https://freetype.org/freetype2/docs/tutorial/step2.html for context on the unreliability of descender metrics.

To ensure that Font::PreparedFontString::getUsedAreaSize() returns
an accurate value without changing glyph positions or line heights,
track descenders using the delta between the glyph's height and its
horiBearingY metric.

See https://freetype.org/freetype2/docs/tutorial/step2.html for
context on the unreliability of descender metrics.
@daid
Copy link
Owner

daid commented Jul 25, 2025

yeah, I know from first hand experience that the metrics from freetype aren't perfect. So I was more thinking along the lines that that 25% you added in the other pull request belongs here to account for "EE" case.

I'm not sure what I think about the height of a prepared text bit being depended on the type of glyph used. As when things are fully scrolling down, like logs, they suddenly can jump if a descender glyph is added to the last line.

(not sure what is better, I'll have to look at the details of the pull request)

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.

2 participants