-
-
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
Bitmap fonts / Custom font issues with the docking branch #2127
Comments
Thanks for your report Sam.
I'll have to look in more details, but I think both issues would be mitigated if you passed your atlas to the (In particular, when merging two windows together in the docking branch, the "host" window is created in |
I remember all sort of weird things happening if I used my custom atlas in |
There are issues with the custom font because of this DearImGui issue: ocornut/imgui#2127 and unfortunately the proposed mitigation will not work out of the box, because we do not provide all the required characters in our font. The best solution would be to add our font characters to the already existing font atlas.
I kept this open in spite of being so old (and probably not relevant to you anymore) as it presented a case that I eventually wanted to facilitate. Ongoing work on WIP branch The expected approach for this particular use case would likely be to create your own Except The specific assert you stumbled on doesn't exist anymore with the new code. There are likely other issues with loading bitmap fonts, but given this is 2018 and the code is going to massively change, I suggest that people interested in this open new issues. The new design for textures means that you could in theory also create independent |
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:
The text was updated successfully, but these errors were encountered: