#9579
Adding overbars/overlines to text, for indicating i.e. inverted signal names.
Version/Branch of Dear ImGui:
Version 1.92, Branch: docking
Back-ends:
imgui_impl_opengl3.cpp + imgui_impl_vulkan.cpp
Compiler, OS:
Windows, Linux / GCC, Clang
Details:
I'd like to implement rendering KiCAD style signal labels, indicating inversed polarity by overlining the signal name. In KiCAD the markup used for this is ~{…}. I can think of several ways to implement this:
- creating a dedicated
ImGui::OverlinedTextfunction - adding support for this kind of markup (or something similar) and render the line in the display list
- using Unicode combining diacritics and addition support for those
Before I charge ahead I'd like collect suggestions and comments on the idea. Any specifics you can think of that might throw me curveballs there?
This is going to be the easiest route.
See what
ImGui::TextLink()is doing:If they are single line labels you can call
ImGui::Text()then readGetItemRectMin()/GetItemRectMax()and apply. I recommend updating to latest git hash on docking as this code changed recently.Note what we are currently fixing various small issues with font metrics and it is possible what your offset calculating might change slightly to be correct in future versions, but it's going to be an easy change.
This is going to be sit over the above code anyhow. This is only going to be useful if you want to submit a large blob of rich/markup text at once. If your labels are submitted by code that derived them from data them a simple helper just to draw the line is enough.
Those are not supported by our text rendering functions.