-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Using PopFont() inside a window causes crash when rendering text in that window #3875
Comments
Thank you for the report. I can confirm there is a bug with |
PushFont/PopFont are described as being "shared stack" but the way they behave actually isn't correctly behaving cross window. |
Same as #3224 moving there. |
I don't mind to cop out from this but last time I looked at this - and been looking for two hours now - the right fix is surprisingly complex especially as they are other elements of the problem not mentioned in those issues: use of multiple atlas, etc. May I suggest in the meanwhile that you workaround the problem using:
|
Using the workaround is alright with me, thank you for your help! |
FYI I have pushed a fix for this now: eb7201b |
Version: 1.81
Branch: master
Back-ends: imgui_impl_sdl.cpp + imgui_impl_opengl3.cpp
Operating System: Windows 10
My Issue/Question:
Hi! I am trying to set a custom font for my window titles (following the sample in this issue), and ran into a crash in the process.
I have loaded two fonts during initialization,
fontSans
andfontTitle
. As expected,fontSans
acts as the default font. However, if I try to set a window title font tofontTitle
the program crashes with the following message:
Assertion failed: font->ContainerAtlas->TexID == _CmdHeader.TextureId, file ...\imgui\imgui_draw.cpp, line 1402
Call stack:
Meanwhile, doing this
works, with the second window using the default font (as expected).
What am I doing wrong?
The text was updated successfully, but these errors were encountered: