I'm loading a custom font in pyimgui:
io = imgui.get_io();
io.fonts.clear()
io.font_global_scale = 1
new_font = io.fonts.add_font_from_file_ttf(
"Broken Glass.ttf", 20.0, io.fonts.get_glyph_ranges_latin()
);
impl.refresh_font_texture()
This is how everyone seems to do it, but it doesn't work. I get:
ImGui assertion error (0) at imgui-cpp/imgui_draw.cpp:1573
every time. I'm on macos big sur.
One way I've been able to reproduce your error is by using an erroneous filename. I suspect your "Broken Glass.ttf" file either contains a typo in the name, or is not located in the root folder of your project, in which case you should use the full path to the .ttf file.
Here's an example of a glfw + imgui implementation with a different font that works for me. Your code is in start():