egui/examples/custom_window_frame
Emil Ernerfeldt 29fa63317e
Fix text sizes being too small (#2069)
Closes https://github.com/emilk/egui/issues/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.
2022-09-21 21:31:08 +02:00
..
src Fix text sizes being too small (#2069) 2022-09-21 21:31:08 +02:00
Cargo.toml Move all crates into a crates directory (#1940) 2022-08-20 10:41:49 +02:00
README.md Move examples out of eframe/examples into examples/ (#1486) 2022-04-13 16:13:24 +02:00

cargo run -p custom_window_frame