Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix text wrapping stability for small text #58145

Merged
merged 2 commits into from
Jul 24, 2024

Conversation

nyalldawson
Copy link
Collaborator

@nyalldawson nyalldawson commented Jul 17, 2024

Adjust the QgsTextRenderer::calculateScaleFactorForFormat logic so that small text is scaled up to at least 50 pixels when calculating text metrics

This avoids tiny differences in calculated text metrics for small text from affecting how text wrapping is calculated, which can otherwise result in words at the end of lines "bouncing" from line to line as layouts and maps are zoomed out

I realise the test mask updates here look scary! I've gone over the results one-by-one and carefully compared before and after rendering. There's no regressions here -- the differences are all sub-pixel changes in font antialiasing, with neither before nor after being significantly better or worse.

@github-actions github-actions bot added this to the 3.40.0 milestone Jul 17, 2024
Copy link

github-actions bot commented Jul 17, 2024

🪟 Windows builds ready!

Windows builds of this PR are available for testing here. Debug symbols for this build are available here.

(Built from commit f71c8ad)

@qgis qgis deleted a comment from github-actions bot Jul 17, 2024
@qgis qgis deleted a comment from github-actions bot Jul 17, 2024
@qgis qgis deleted a comment from github-actions bot Jul 18, 2024
@qgis qgis deleted a comment from github-actions bot Jul 18, 2024
@qgis qgis deleted a comment from github-actions bot Jul 18, 2024
@qgis qgis deleted a comment from github-actions bot Jul 18, 2024
@qgis qgis deleted a comment from github-actions bot Jul 18, 2024
@qgis qgis deleted a comment from github-actions bot Jul 18, 2024
@qgis qgis deleted a comment from github-actions bot Jul 19, 2024
@qgis qgis deleted a comment from github-actions bot Jul 19, 2024
@qgis qgis deleted a comment from github-actions bot Jul 19, 2024
@qgis qgis deleted a comment from github-actions bot Jul 19, 2024
@qgis qgis deleted a comment from github-actions bot Jul 19, 2024
@qgis qgis deleted a comment from github-actions bot Jul 19, 2024
@qgis qgis deleted a comment from github-actions bot Jul 20, 2024
@qgis qgis deleted a comment from github-actions bot Jul 20, 2024
@qgis qgis deleted a comment from github-actions bot Jul 20, 2024
@qgis qgis deleted a comment from github-actions bot Jul 20, 2024
@qgis qgis deleted a comment from github-actions bot Jul 20, 2024
@qgis qgis deleted a comment from github-actions bot Jul 21, 2024
@qgis qgis deleted a comment from github-actions bot Jul 21, 2024
Adjust the QgsTextRenderer::calculateScaleFactorForFormat logic
so that small text is scaled up to at least 50 pixels when
calculating text metrics

This avoids tiny differences in calculated text metrics for small
text from affecting how text wrapping is calculated, which can
otherwise result in words at the end of lines "bouncing" from line
to line as layouts and maps are zoomed out
@nyalldawson nyalldawson merged commit 23f51dd into qgis:master Jul 24, 2024
30 checks passed
@nyalldawson nyalldawson deleted the scaling_factor branch July 24, 2024 18:02
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