Closed XMNXofficial closed 1 year ago
Hi,
Thanks for sharing your demo code, it makes it easier to answer.
Fonts need to be loaded at the appropriate moment during initialization. I updated a demo example to showcase how to load fonts.
First, you will need to create a function (or lambda) for loading the font:
Then, you need to use RunnerParams and fill the correct callback: https://github.com/pthom/hello_imgui/blob/0a2859a942c3d4fb86b652929b7f3e4b1cd98e76/src/hello_imgui_demos/hello_imgui_demo_classic/hello_imgui_demo_classic.main.cpp#L15-L22
And then use the font: https://github.com/pthom/hello_imgui/blob/0a2859a942c3d4fb86b652929b7f3e4b1cd98e76/src/hello_imgui_demos/hello_imgui_demo_classic/hello_imgui_demo_classic.main.cpp#L40-L43
Thank you very much for your great help!
Hello👋! I want to load a ttf font into hello_imgui,but it can't work;
⬇⬇It likely load success,but it show "unknown". And when i select it,my program will crash ( show: 18762 segmentation fault (core dumped) ./hello_world ).![image](https://user-images.githubusercontent.com/112557849/229705474-b5240515-0cd9-443c-a003-c567ab308574.png)
_example_integration.zip