-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Text size is smaller than it should be #2068
Comments
This was referenced Sep 21, 2022
First finding: I need to use https://docs.rs/ab_glyph/latest/ab_glyph/trait.Font.html#method.pt_to_px_scale |
emilk
added a commit
that referenced
this issue
Sep 21, 2022
Closes #2068 Before this PR, the default font, Ubuntu-Light, was ~11% smaller than it should have been, and the default monospace font, Hack, was ~14% smaller. This means that setting the font size `12` in egui would yield smaller text than using that font size in any other app. Ooops! The change is that this PR now takes into account the ttf properties `units_per_em` and `height_unscaled`. If your egui application has specified you own font sizes or text styles you will see the text in your application grow larger, unless you go in and compensate by dividing all font sizes by ~1.21 for Ubuntu-Light/Proportional and ~1.16 for Hack/Monospace, and with something else if you are using a custom font! This effects any use of `FontId`, `RichText::size`, etc. This PR changes the default `Style::text_styles` to compensate, so the default egui style should look the same before and after this PR.
emilk
added a commit
that referenced
this issue
Sep 21, 2022
Closes #2068 Before this PR, the default font, Ubuntu-Light, was ~11% smaller than it should have been, and the default monospace font, Hack, was ~14% smaller. This means that setting the font size `12` in egui would yield smaller text than using that font size in any other app. Ooops! The change is that this PR now takes into account the ttf properties `units_per_em` and `height_unscaled`. If your egui application has specified you own font sizes or text styles you will see the text in your application grow larger, unless you go in and compensate by dividing all font sizes by ~1.21 for Ubuntu-Light/Proportional and ~1.16 for Hack/Monospace, and with something else if you are using a custom font! This effects any use of `FontId`, `RichText::size`, etc. This PR changes the default `Style::text_styles` to compensate, so the default egui style should look the same before and after this PR.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is Ubuntu-Light (the default egui font) in the official Mac Font Book app (upper) and in egui (lower):
The text in egui is obviously much smaller, even though both should be size 12.
Repro:
The text was updated successfully, but these errors were encountered: