Read the system CJK font once, and hold fonts as ImFont pointers

Each of the four fonts merged the system CJK font from a fresh read of its file, twice, and never freed it.
It is now read once and shared. Startup memory with a document open went from 412 MB to 269 MB.
This commit is contained in:
shweet committed 2026-11-22 17:44:07 -05:00
1 parent 2f1e75da37
commit 20209e655e
12 files changed
+58 -106

No files matched your search

+1 -1
View File
@@ -720,7 +720,7 @@ void animations_update(Panel& panel, AnimationsPanel& animations)
tooltip_name_draw(resources, animation.name);
if (model.animations.defaultAnimation == animation.name)
{
ImGui::PushFont(resources.fonts[FONT_ITALICS].get(), FONT_SIZE);
ImGui::PushFont(resources.fonts[FONT_ITALICS], FONT_SIZE);
ImGui::TextUnformatted(localize.get(BASIC_DEFAULT));
ImGui::PopFont();
}