IO FontAtlas memory corrupted? #6218
Replies: 2 comments 9 replies
-
You need to use triple-backticks for multiple lines. IE:
becomes // Say hello
printf("Hello, world!");
This assert should not be ignored. It sounds like your app isn't calling things in the correct order and you need to debug it to figure out what's wrong with it. A good strategy would be to place a breakpoint in |
Beta Was this translation helpful? Give feedback.
-
Just was able to get a custom font working. static void ImGui_ImplDX11_CreateFontsTexture()
{
// Build texture atlas
ImGuiIO& io = ImGui::GetIO();
io.Fonts->AddFontDefault();
auto myfont= io.Fonts->AddFontFromFileTTF("....\\arial.ttf", 14.0f);
ImGui_ImplDX11_Data* bd = ImGui_ImplDX11_GetBackendData();
..... Not a great way of doing it especially when it comes to getting a new update of imgui but it works for now. |
Beta Was this translation helpful? Give feedback.
-
Hey there im using ImGUI for over 1 year and didn't run into a single problem yet except for now.
Every method accessing the Fonts in the current IO runs into a problem.
-I upgraded to latest v1.89.3
-Im using ImGui_ImplWin32 and ImGui_ImplDX11
-The whole GUI gets loaded via dynamic link library based on the Platform the user is on
I have read the FAQ, the FONTS.md, the Changelog and searched the github issues. But i can't seem to find a fix for that problem.
And yes im able to read the assert but InitImGui is called before NewFrame thats why i dont get it.
I traced every call where the fontatlas is built / locked like GetTexDataAsRGBA32 and insured they dont get called before doing something with io.Fonts
I tried setting fontcfg.FontDataOwnedByAtlas = false; and passing an shared_fontatlas though CreateContext();.
So im 99% sure io.Fonts isn't having valid data and therefor im not able to access its values. But i dont get why im able to use the default Font when I dont call anything font related. So imGui internals itself has a valid Fontatlas and is able to use it but when I'm getting the Fontatlas through io.Fonts its rubbish? Though of some memory error like maybe IM_NEW and dll's don't like each other? But then why is the default font built correctly?
I know its probs an error with my specific setup but does anyone have an idea what im able to try next? Is the default font when nothing is changed in io.Fonts built with the default fontatlas?
Screenshots are attached (dev envoirement is german but basically it tells that memory cant be read)
Thanks for your time
![fa](https://user-images.githubusercontent.com/102036089/222752233-50ca106c-230c-4e00-a544-3b55a4cd530b.jpg)
-Edge
Beta Was this translation helpful? Give feedback.
All reactions