egui/examples
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
..
confirm_exit eframe: rename quit/exit to "close" (#1943) 2022-08-20 16:08:59 +02:00
custom_3d_glow Move all crates into a crates directory (#1940) 2022-08-20 10:41:49 +02:00
custom_3d_three-d Make eframe::App::as_any_mut optional to implement (#2061) 2022-09-20 13:58:55 +02:00
custom_font Move all crates into a crates directory (#1940) 2022-08-20 10:41:49 +02:00
custom_font_style Fix text sizes being too small (#2069) 2022-09-21 21:31:08 +02:00
custom_window_frame Fix text sizes being too small (#2069) 2022-09-21 21:31:08 +02:00
download_image Move all crates into a crates directory (#1940) 2022-08-20 10:41:49 +02:00
file_dialog Update crate rfd to 0.10 (in file_dialog example) 2022-08-20 14:42:37 +02:00
hello_world Move all crates into a crates directory (#1940) 2022-08-20 10:41:49 +02:00
puffin_profiler Move all crates into a crates directory (#1940) 2022-08-20 10:41:49 +02:00
retained_image Add custom shader_version on glow renderer (#1993) 2022-09-06 10:08:16 +02:00
screenshot Move all crates into a crates directory (#1940) 2022-08-20 10:41:49 +02:00
serial_windows eframe: rename quit/exit to "close" (#1943) 2022-08-20 16:08:59 +02:00
svg Move all crates into a crates directory (#1940) 2022-08-20 10:41:49 +02:00
README.md Fix broken GitHub source links due to #1940 2022-08-20 15:18:02 +02:00

egui and eframe examples

All the examples in this folder uses eframe to set up a window for egui. Some examples are specific to eframe, but many are applicable to any egui integration.

There are a lot more examples at https://www.egui.rs, and it has links to the source code of each example.

Also check out the official docs at https://docs.rs/egui and https://docs.rs/eframe.