-
Notifications
You must be signed in to change notification settings - Fork 10.4k
raylib: font sizes from QT should match #36237
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
Conversation
raylib UI Preview |
|
just using a const to approximate. real scales: {3: 1.2658227848101267, 4: 1.2658227848101267, 5: 1.2658227848101267, 6: 1.25, 7: 1.2422360248447204, 8: 1.2345679012345678, 9: 1.2195121951219512, 10: 1.2195121951219512, 11: 1.2121212121212122} |
|
a lot of the fonts are just scaled with the origin at the top because the functions that call the text rendered assume the height will be what they pass in. can't easily solve without replacing all text sizes across the UI in the code manually, so will leave for later. you can see the diff above, it doesn't look egregiously off center |


















































gpt5 thinks qt is considering the text top/ascent and bottom/descent and raylib is not: https://stackoverflow.com/questions/27631736/meaning-of-top-ascent-baseline-descent-bottom-and-leading-in-androids-font
you can see qt's text height is ~1.2x the set text height
both cases the red line is set to the font size. in raylib the red line spans the text rect, in qt the text rect expands past. so qt must calculate the text size differently