Open samhocevar opened 6 years ago
Thanks for your report Sam.
the default font is still used for windows/tab titles the application randomly crashes when playing around with the dock:
I'll have to look in more details, but I think both issues would be mitigated if you passed your atlas to the ImGui::CreateContext()
call so your atlas and your font becomes the default font. Is that what you did in your actual application?
(In particular, when merging two windows together in the docking branch, the "host" window is created in NewFrame()
using the default font. Which can be slightly problematic, but my solutions for it currently have other issues.)
I remember all sort of weird things happening if I used my custom atlas in ImGui::CreateContext()
but that wasn’t with a minimal repro case, so I’ll double check!
I am using custom bitmap fonts instead of using the TTF engine. There are three major reasons for using bitmap fonts:
However, with the docking branch, I cannot seem to properly override the default font using
PushFont()
. Here is what happens:../../imgui_draw.cpp:1177: void ImDrawList::AddText(const ImFont*, float, const ImVec2&, ImU32, const char*, const char*, float, const ImVec4*): Assertion `font->ContainerAtlas->TexID == _TextureIdStack.back()' failed.
Maybe I am doing something wrong, since custom fonts are not really documented and I know the API has a lot of legacy… but that code used to work perfectly without docking.
Here is a patch that modifies
example_sdl_opengl3
to demonstrate the two problems above : patch-bitmap-font-test.diff.txtBelow is the font creation part if you have any comments on it: