egui/examples
StarStarJ 3f5cd74de7
Put font data into Arc to reduce memory consumption (#5276)
egui never accesses the `FontDefinitions`' member fields mutably, except
in `fonts_tweak_ui` where it cloned the `FontDefinitions` object anyway.

This patch reduces system memory consumption for shared font
definitions.
And also removes some overhead from copying (e.g. for the per
`pixel_per_points` font atlas)

Also it allows to keep a copy of the font definitions outside of egui.

In my App that uses international fonts:
Before:

![image](https://github.com/user-attachments/assets/f8dfb4f4-a21c-447c-8cf9-83025ad6e960)

New:

![image](https://github.com/user-attachments/assets/9f297fbd-e620-4b7e-a32a-65073ee805ed)


Note: If `Arc` is not wanted, then it could ofc be abstracted away.

I know this is quite a breaking change API wise, but would like to hear
your opinion.
2024-11-01 13:30:02 +01:00
..
confirm_exit Update MSRV from 1.76 to 1.77 (#5322) 2024-10-30 09:06:34 +01:00
custom_3d_glow Update MSRV from 1.76 to 1.77 (#5322) 2024-10-30 09:06:34 +01:00
custom_font Put font data into Arc to reduce memory consumption (#5276) 2024-11-01 13:30:02 +01:00
custom_font_style Update MSRV from 1.76 to 1.77 (#5322) 2024-10-30 09:06:34 +01:00
custom_keypad Update MSRV from 1.76 to 1.77 (#5322) 2024-10-30 09:06:34 +01:00
custom_style Update MSRV from 1.76 to 1.77 (#5322) 2024-10-30 09:06:34 +01:00
custom_window_frame Update MSRV from 1.76 to 1.77 (#5322) 2024-10-30 09:06:34 +01:00
file_dialog Update MSRV from 1.76 to 1.77 (#5322) 2024-10-30 09:06:34 +01:00
hello_world Update MSRV from 1.76 to 1.77 (#5322) 2024-10-30 09:06:34 +01:00
hello_world_par Update MSRV from 1.76 to 1.77 (#5322) 2024-10-30 09:06:34 +01:00
hello_world_simple Update MSRV from 1.76 to 1.77 (#5322) 2024-10-30 09:06:34 +01:00
images Update MSRV from 1.76 to 1.77 (#5322) 2024-10-30 09:06:34 +01:00
keyboard_events Update MSRV from 1.76 to 1.77 (#5322) 2024-10-30 09:06:34 +01:00
multiple_viewports Update MSRV from 1.76 to 1.77 (#5322) 2024-10-30 09:06:34 +01:00
popups Add `ComboBox::close_behavior` (#5305) 2024-10-29 12:39:44 +01:00
puffin_profiler Update MSRV from 1.76 to 1.77 (#5322) 2024-10-30 09:06:34 +01:00
screenshot Update MSRV from 1.76 to 1.77 (#5322) 2024-10-30 09:06:34 +01:00
serial_windows Update MSRV from 1.76 to 1.77 (#5322) 2024-10-30 09:06:34 +01:00
user_attention Update MSRV from 1.76 to 1.77 (#5322) 2024-10-30 09:06:34 +01:00
README.md examples/README.md: explain that the examples are for master 2023-02-08 20:34:43 +01:00
run_all.sh Fix up some examples (#3614) 2023-11-23 12:58:44 +01:00

README.md

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.

Note that all the examples on master are for the latest master version of egui.

If you want to look for examples for a specific version of egui, go to that tag, e.g. https://github.com/emilk/egui/tree/latest/examples.