Open SalavatR opened 1 year ago
It looks like it is font related. Are you using a custom font and imgui.font_add_ttf_data()? If so, is the font available and loaded correctly?
yes, it works like a charm on all available devices and browsers, but i got this error in sentry
this error never happens if we run directly html page our QA sometimes cought it only in iframe on platforms
our QA sometimes cought it only in iframe on platforms
Interesting. How are you loading the font?
imgui.set_ini_filename()
imgui.set_ini_filename("devtool.ini")
-- dv.set_style()
imgui.set_style_color(imgui.ImGuiCol_MenuBarBg, 1.0, 0.01, 0.02, 0.01)
local w, h = window.get_size()
local global_font_scale = 2.2
local scale_all_sizes = 2.5
if w > h then
global_font_scale = global_font_scale * w / display_height
else
global_font_scale = global_font_scale * h / display_height
end
imgui.scale_all_sizes(scale_all_sizes)
local regular_data, error = sys.load_resource("/assets/imgui_res/space_mono_regular.ttf")
if sysutil.is_android() then
imgui.set_global_font_scale(global_font_scale)
elseif regular_data then
imgui.font_add_ttf_data(regular_data, #regular_data, 12.0 * global_font_scale, 12.0 * global_font_scale)
end
imgui/src/imgui/imgui_draw.cpp,1899,AddFont
I should probably update to the latest version of DearImGUI. The version used in this extension is two years old. It might help.
One thing which you could do is to add some printf()'s in imgui_draw.cpp:1899 to check what exactly it is asserting on.
@SalavatR would you mind trying with the latest version? It was updated to ImGui 1.89.9. And if it doesn't work then please provide a sample project that I can try.
Hello! i found repro case on mac os
https://yandex.ru/games/app/183506
if i open many tabs very fast i got error:
But i got it only in iframes, can't get when open direct links from cnd https://cdn.mergeitgame.com/html5/yg/index.html https://cdn.mergeitgame.com/html5/vk/index.html https://cdn.mergeitgame.com/html5/ok/index.html
if i open many tabs very fast i got error:
I can also reproduce this. I looked more closely at the code when the font is loaded from memory and there is a memory allocation that might fail. I've now added a check for this and a dmLogWarning(). Perhaps you could try the new version and see if the failed allocation was the reason?
https://github.com/britzl/extension-imgui/releases/tag/2.3.1
still same error
That is not exactly the same error though. Initially it was IM_ASSERT(font_cfg->FontData != NULL && font_cfg->FontDataSize > 0);
but now it is IM_ASSERT(font_cfg->SizePixels > 0.0f);
What is the size you are passing to imgui.font_add_ttf_data()
?
hi! after release on html5 platform, we got errors, can't reproduce local
"RuntimeError: abort(Assertion failed: font_cfg->FontData != 0L && font_cfg->FontDataSize > 0, at: upload/imgui/src/imgui/imgui_draw.cpp,1899,AddFont). Build with -s ASSERTIONS=1 for more info.","abort@anonymous>:1:12355","___assert_fail@<anonymous:1:19145"