Skip to content

Commit cfbff56

Browse files
committed
Implement ExtraLineHeight and ExtraLineAdvance (fixup: Expose ExtraLineHeight and ExtraLineAdvance in style editor)
1 parent 64208ed commit cfbff56

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

imgui.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11968,7 +11968,13 @@ void ImGui::DebugNodeFont(ImFont* font)
1196811968
"You may oversample them to get some flexibility with scaling. "
1196911969
"You can also render at multiple sizes and select which one to use at runtime.\n\n"
1197011970
"(Glimmer of hope: the atlas system will be rewritten in the future to make scaling more flexible.)");
11971+
SetNextItemWidth(GetFontSize() * 8);
11972+
DragFloat("Extra line height", &font->ExtraLineHeight, 1.0f, -font->FontSize, FLT_MAX, "%g");
11973+
SetNextItemWidth(GetFontSize() * 8);
11974+
DragFloat("Extra line advance", &font->ExtraLineAdvance, 1.0f, -FLT_MAX, FLT_MAX, "%g");
1197111975
Text("Ascent: %f, Descent: %f, Height: %f", font->Ascent, font->Descent, font->Ascent - font->Descent);
11976+
Text("Line Height: %f", font->FontSize + font->ExtraLineHeight, font->Ascent - font->Descent + font->ExtraLineHeight + font->ExtraLineAdvance);
11977+
Text("Line Advance: %f", font->FontSize + font->ExtraLineHeight + font->ExtraLineAdvance);
1197211978
char c_str[5];
1197311979
Text("Fallback character: '%s' (U+%04X)", ImTextCharToUtf8(c_str, font->FallbackChar), font->FallbackChar);
1197411980
Text("Ellipsis character: '%s' (U+%04X)", ImTextCharToUtf8(c_str, font->EllipsisChar), font->EllipsisChar);

0 commit comments

Comments
 (0)