-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
3 changed files
with
25 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters