-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build Font Async #7271
Comments
Running in a thread doesn't make sense if the other thread needs the font data. I don't think there is a good straightforward solution: our model with prebuilding glyphs is flawed and problematic but we should fix it this year. Until now, you can:
|
Closing as answered. |
you can load ImFontAtlas async,ImFont is base on it,when you finish ImFontAtlas's load(Texture UpLoad To GPU device),you can set font anywhere |
Current WIP branch for dynamic_fonts (#8465) makes it obsolete. Even though the branch is not merged yet, it should be this soonish. |
Version/Branch of Dear ImGui:
Version v1.90.0
Back-ends:
imgui_impl_win32.cpp + imgui_impl_dx11.cpp
Compiler, OS:
WIndows 10 + MSVC
Full config/build information:
Details:
My Issue/Question:
I tried to load font with GlyphRangesChineseFull, but it will take long time (about 6-10 seconds) at game frame presenting
I loaded font using this call:
but imgui did't build font yet, until I call this:
I traced it to ImFontBuilderIO::FontBuilder_Build function:
I tried to using std::thread or std::async with lambda expressions to solve it like this but failed with some error
Screenshots/Video:
Minimal, Complete and Verifiable Example code:
The text was updated successfully, but these errors were encountered: