How could I load fonts with non-latin characters more efficiently? #3843
Replies: 2 comments 3 replies
-
There is no better way. Best you can do is load all your fonts during program initialization where such hang is less of an intrusion. We are working on font atlas improvements that would allow on-demand rasterization of characters, but that will materialize a good while in the future. |
Beta Was this translation helpful? Give feedback.
-
It's confusing why you say you are doing this in your "present function" since the atlas needs to be built prior to the frame beginning (first
As Rokups say we are well aware that's an issue and aim to work on meaningful improvement in the next few months hopefully. (Bonus link https://github.com/ocornut/imgui/blob/master/docs/FONTS.md) |
Beta Was this translation helpful? Give feedback.
-
I'm loading fonts in my present function using the following code:
I found this can be quite slow and freeze the UI thread. I have tried to move this initialization to a background thread before present is called. This seems to improve things. However when
ImGui_ImplDX11_CreateFontsTexture
is called inImGui_ImplDX11_NewFrame
, the UI will still hang. Would anyone happen to have any suggestions on some ways I can improve this?Beta Was this translation helpful? Give feedback.
All reactions