Crach when missing EllipsisChar glyph #6480

Closed
opened 2023-05-31 10:41:30 +00:00 by slajerek · 3 comments
slajerek commented 2023-05-31 10:41:30 +00:00 (Migrated from github.com)

Version/Branch of Dear ImGui:

Version: commit 3418d50949
Branch: docking

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_opengl3.cpp + imgui_impl_sdl2.cpp
Compiler: Xcode
Operating System: macOS

My Issue/Question:

I updated ImGui after very long time. It compiles fine, no code changes required on my end, but now I get immediately during startup procedure a crash in imgui_draw.cpp, line 3223:
EllipsisWidth = EllipsisCharStep = FindGlyph(EllipsisChar)->X1;

The FindGlyph returns FallbackGlyph, and that is NULL. I am using default font, it is pretty simple init procedure, do I miss something, was API changed or I need to additionally init font or something?

Thanks in advance.

**Version/Branch of Dear ImGui:** Version: commit 3418d509490c0f1dd4bc6c3ba2a9312e8efc0ff9 Branch: docking **Back-end/Renderer/Compiler/OS** Back-ends: imgui_impl_opengl3.cpp + imgui_impl_sdl2.cpp Compiler: Xcode Operating System: macOS **My Issue/Question:** I updated ImGui after very long time. It compiles fine, no code changes required on my end, but now I get immediately during startup procedure a crash in imgui_draw.cpp, line 3223: `EllipsisWidth = EllipsisCharStep = FindGlyph(EllipsisChar)->X1;` The FindGlyph returns FallbackGlyph, and that is NULL. I am using default font, it is pretty simple init procedure, do I miss something, was API changed or I need to additionally init font or something? Thanks in advance.
slajerek commented 2023-05-31 11:07:19 +00:00 (Migrated from github.com)

Oh, it seems that's my bug, I had in the font setup code:
font_cfg.EllipsisChar = (ImWchar)0x0085;

It seems that char is not there and the ellipsis char was changed to 0x2026.

I wonder if that should not be an assert?

Oh, it seems that's my bug, I had in the font setup code: `font_cfg.EllipsisChar = (ImWchar)0x0085;` It seems that char is not there and the ellipsis char was changed to 0x2026. I wonder if that should not be an assert?
ocornut commented 2023-05-31 12:36:32 +00:00 (Migrated from github.com)

Thank you, I can confirm that it shouldn't crash bluntly. I'll look now.

Thank you, I can confirm that it shouldn't crash bluntly. I'll look now.
ocornut commented 2023-05-31 12:45:19 +00:00 (Migrated from github.com)

Fixed with 075b975

Fixed with 075b975
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#6480
No description provided.