imgui_freeetype: Updated suggested test code.
diff --git a/misc/freetype/README.md b/misc/freetype/README.md
index 156e651..4c53cd9 100644
--- a/misc/freetype/README.md
+++ b/misc/freetype/README.md
@@ -67,6 +67,7 @@
FontBuildMode BuildMode;
bool WantRebuild;
float FontsMultiply;
+ int FontsPadding;
unsigned int FontsFlags;
FreeTypeTest()
@@ -74,6 +75,7 @@
BuildMode = FontBuildMode_FreeType;
WantRebuild = true;
FontsMultiply = 1.0f;
+ FontsPadding = 1;
FontsFlags = 0;
}
@@ -85,8 +87,10 @@
ImGuiIO& io = ImGui::GetIO();
for (int n = 0; n < io.Fonts->Fonts.Size; n++)
{
- io.Fonts->Fonts[n]->ConfigData->RasterizerMultiply = FontsMultiply;
- io.Fonts->Fonts[n]->ConfigData->RasterizerFlags = (BuildMode == FontBuildMode_FreeType) ? FontsFlags : 0x00;
+ ImFontConfig* font_config = (ImFontConfig*)io.Fonts->Fonts[n]->ConfigData;
+ io.Fonts->TexGlyphPadding = FontsPadding;
+ font_config->RasterizerMultiply = FontsMultiply;
+ font_config->RasterizerFlags = (BuildMode == FontBuildMode_FreeType) ? FontsFlags : 0x00;
}
if (BuildMode == FontBuildMode_FreeType)
ImGuiFreeType::BuildFontAtlas(io.Fonts, FontsFlags);
@@ -105,6 +109,7 @@
ImGui::SameLine();
WantRebuild |= ImGui::RadioButton("Stb (Default)", (int*)&BuildMode, FontBuildMode_Stb);
WantRebuild |= ImGui::DragFloat("Multiply", &FontsMultiply, 0.001f, 0.0f, 2.0f);
+ WantRebuild |= ImGui::DragInt("Padding", &FontsPadding, 0.1f, 0, 16);
if (BuildMode == FontBuildMode_FreeType)
{
WantRebuild |= ImGui::CheckboxFlags("NoHinting", &FontsFlags, ImGuiFreeType::NoHinting);