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

[rtext] Adjust font atlas area calculation so padding area is not underestimated at small font sizes. #3719

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

tromero
Copy link
Contributor

@tromero tromero commented Jan 9, 2024

#3717

The old padding*4 results in around 80px of padding area when the actual amount of padding area was 144px. Adding the padding to the width and height separately instead of only to width should give the exact amount of area after padding, and should better account for fonts with very wide glyphs. With this change I no longer lose glyphs even at impractically small font sizes in the 1-7px range. The 1.2x constant could potentially be reduced now that the area calculation is more accurate.

image

@raysan5 raysan5 merged commit 2c124c9 into raysan5:master Jan 10, 2024
14 checks passed
@raysan5
Copy link
Owner

raysan5 commented Jan 10, 2024

@tromero thanks for the review! This issue has been actually reviewed many times...

@tromero tromero deleted the font-atlas-size-3717 branch January 11, 2024 06:07
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