Skip to content

Commit

Permalink
Implement ExtraLineHeight and ExtraLineAdvance (fixup: Expose ExtraLi…
Browse files Browse the repository at this point in the history
…neHeight and ExtraLineAdvance in style editor)
  • Loading branch information
thedmd committed Nov 20, 2021
1 parent 64208ed commit cfbff56
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11968,7 +11968,13 @@ void ImGui::DebugNodeFont(ImFont* font)
"You may oversample them to get some flexibility with scaling. "
"You can also render at multiple sizes and select which one to use at runtime.\n\n"
"(Glimmer of hope: the atlas system will be rewritten in the future to make scaling more flexible.)");
SetNextItemWidth(GetFontSize() * 8);
DragFloat("Extra line height", &font->ExtraLineHeight, 1.0f, -font->FontSize, FLT_MAX, "%g");
SetNextItemWidth(GetFontSize() * 8);
DragFloat("Extra line advance", &font->ExtraLineAdvance, 1.0f, -FLT_MAX, FLT_MAX, "%g");
Text("Ascent: %f, Descent: %f, Height: %f", font->Ascent, font->Descent, font->Ascent - font->Descent);
Text("Line Height: %f", font->FontSize + font->ExtraLineHeight, font->Ascent - font->Descent + font->ExtraLineHeight + font->ExtraLineAdvance);
Text("Line Advance: %f", font->FontSize + font->ExtraLineHeight + font->ExtraLineAdvance);
char c_str[5];
Text("Fallback character: '%s' (U+%04X)", ImTextCharToUtf8(c_str, font->FallbackChar), font->FallbackChar);
Text("Ellipsis character: '%s' (U+%04X)", ImTextCharToUtf8(c_str, font->EllipsisChar), font->EllipsisChar);
Expand Down

0 comments on commit cfbff56

Please sign in to comment.