-
-
Notifications
You must be signed in to change notification settings - Fork 10k
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
crash with Font #951
Comments
Is your filename correct? I am not sure what \ means in your language but in c++ it would escape the next character.
Do you have asserts enabled? It looks like you are missing some diagnostics checks.
… On 24 Dec 2016, at 12:32, Victor Bombi ***@***.***> wrote:
Hello Omar,
If I use:
imgui.ImGui_ImplGlfwGL3_Init(self.window, false);
imgui.ImFontAtlas_AddFontFromFileTTF(imgui.igGetIO().Fonts, [[C:\luaGL\ProggyTiny.ttf]], 10, nil, nil)
I am getting crashes so I did gdb with Debug and RelWithDebInfo:
--Debug version
Program: C:\luaGL\luajit.exe
File: C:\luaGL\gitsources\cimgui\imgui\imgui_draw.cpp, Line 1278
Expression: font_offset >= 0
This application has requested the Runtime to terminate it in an unusual way.
--RelWithDebInfo
Program received signal SIGSEGV, Segmentation fault.
SetCurrentFont (font=0x3be170) at C:\luaGL\gitsources\cimgui\imgui\imgui.cpp:4636
4636 g.FontTexUvWhitePixel = g.Font->ContainerAtlas->TexUvWhitePixel;
Thread 1 (Thread 4812.0xa24):
#0 SetCurrentFont (font=0x3be170) at C:\luaGL\gitsources\cimgui\imgui\imgui.cpp:4636
#1 0x6bd13a66 in ImGui::NewFrame () at C:\luaGL\gitsources\cimgui\imgui\imgui.cpp:2142
#2 0x6bd4066b in ImGui_ImplGlfwGL3_NewFrame ()
at C:\luaGL\gitsources\cimgui\extras\impl_glfw3\imgui_impl_glfw_gl3.cpp:401
#3 0x66d84bb2 in ?? () from C:\luaGL\lua51.dll
but I am not able to make conclusions.
1278 is ImFontAtlas::Build()
Thanks
―
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Filename is ok in Lua and ImFontAtlas_AddFontFromFileTTF returns not null. |
Assert being enabled or not is up your building configuration and where it goes when calling assert(), unless you have redefined IM_ASSERT in imconfig.h
From your log your should have stopped/crashed on the IM_ASSERT(font_offset >= 0); line and not gone any further than that.
We are calling stbtt_GetFontOffsetForIndex() and it returns an error so either the font data is invalid, either the FontNo is invalid, either there is a bug/issue in stb_truetype.h.
Maybe first try with one of the ttf file provided in extra_fonts/ because those definitively works.
…Sent from my fax machine
|
I could check that the pointer in SetCurrentFont is the same returned from ImFontAtlas_AddFontFromFileTTF |
ProggyTiny.ttf is from extra_fonts |
Also : there are two gdb traces, one for Debug the other for Release with debug information |
Use a debugger to trace thru the code!
|
|
A lot of noise for: Fake ProggyTiny.ttf |
Your assert should really crash/halt your application, this is what asserts are for. |
Hello Omar,
If I use:
I am getting crashes so I did gdb with Debug and RelWithDebInfo:
but I am not able to make conclusions.
1278 is ImFontAtlas::Build()
Thanks
The text was updated successfully, but these errors were encountered: