Open makew0rld opened 2 years ago
Hello, I believe this is the same issue as #2945 Its simultaneously trivial and tricky as given the general use of FontSize as line height in much code, the most accessible solution is to bake GlyphExtraSpacing.y into output FontSize so Input FontSize will be != Output FontSize.
Will at least add this feature mentioned in #2945
Hi,
Is there an estimate when we can have this implemented? I have hacked an effective equivalent of this feature with SetCursorScreenPos()
, but I would like to just set one parameter instead of sprinkling cursor adjustments across the code, along with modifications to the value returned by GetFontSize()
.
In the screenshot below the left hand side shows adjusted font height (with some issues, as only the cursor is moved, and the font height is left as is), and the right hand side shows how the text is rendered without any modifications.
Is there an estimate when we can have this implemented?
Not too long. https://github.com/ocornut/imgui/pull/4742
ExtraLineHeight=0 |
ExtraLineHeight=8 |
---|---|
My Issue/Question:
I am using a custom font that has minimal vertical margins. This makes reading text with the font difficult. Obviously I can modify the font to increase those, but modifying fonts is non-trivial and error-prone. I was hoping that Dear Imgui would have a way to set the line height/spacing for the font, or some way to add more vertical margin. That way whenever the font was used, it would have the desired spacing.
Screenshots/Video
Standalone, minimal, complete and verifiable example: (see https://github.com/ocornut/imgui/issues/2261)
The font I am using is
AcPlus_IBM_BIOS.ttf
, as seen here. It can be downloaded as part of this ZIP.I am using DearPyGUI so I don't have C/C++ code for you. I filed this issue here because I can't find anything about this in the upstream API.
My Python code simply just loads the font and the demo:
Thank you!