Obsoleted CalcWordWrapPositionA
It seems CalcWordWrapPositionA will be obsolete once dynamic_fonts branch is released.
I've replaced it with CalcWordWrapPosition which use current font size, obtained with ImGui::GetFontSize()
See https://github.com/ocornut/imgui/issues/8465
It looks like CalcWordWrapPosition is not yet in Dear ImGui, so this needs a macro check for ImGui version IMGUI_VERSION_NUM or a feature macro test, though it looks like there isn't a IMGUI_HAS_DYNAMIC_FONTS.
Neither would work at the moment since the IMGUI_VERSION_NUM of the main branch is higher than the dynamic font branch, so for the moment I'll hold off on merging until this is clarified in ImGui.
Yes. This is why I made it as a draft PR. More as a remainder :) Internally I use imgui_markdown with dynamic_fonts branch so I hope I will be able to test this and update PR if something go wrong.
Excellent - thanks. Somehow I didn't notice this was a draft!
FYI it's been pushed on May 23 https://github.com/ocornut/imgui/commit/407a0b972eac6166095d2b5b5b0896bad6e9687a
You can use #if IMGUI_VERSION_NUM > 19197 if you want to support old versions.
Also I suggest you cache this e.g. float size = ImGui::GetFontSize().
I've merged this into dev branch so I can work on the suggestions from @ocornut. Many thanks for the PR!
This is now merged into main with the changes suggested, though I used #if IMGUI_VERSION_NUM >= 19197 as 19197 seems to be the wip version.