You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my case, I need to load the entire unicode plain 0 glyph, and since imgui re-rasterises the glyphs each time it runs, it takes quite a while to start it up each time.
In most cases, we don't need to change the font, so why can't we reuse the previously generated textures and UV coordinates?
After much trial and error, I finally found what seems to work to save and restore the font atlas properly.
For now even thought I appreciate the interested/need and sharing of code snippets, my priority will be to re-overhaul the system to not need those ranges. First step being #3761 for 1.90.
Version/Branch of Dear ImGui:
Version: 1.89.2
Branch: master
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_opengl3.cpp + imgui_impl_glfw.cpp
Compiler: MSVC
Operating System: windows11
My Issue/Question:
This may be useful for some people.
In my case, I need to load the entire unicode plain 0 glyph, and since imgui re-rasterises the glyphs each time it runs, it takes quite a while to start it up each time.
In most cases, we don't need to change the font, so why can't we reuse the previously generated textures and UV coordinates?
After much trial and error, I finally found what seems to work to save and restore the font atlas properly.
Standalone, minimal, complete and verifiable example: (see #2261)
Save font atlas cache
Load font atlas cache(No need reload ttf)
By testing, it takes 1.7s to load TTF and build, whereas loading the cache directly reduces it to 0.3s, which is a massive improvement!
But I don't know if
restore_font_atlas
is correct, at least from my computer it works perfectlyThe text was updated successfully, but these errors were encountered: