Fonts: OversampleH/OversampleV value defaults to 0 for automatic selection.

This commit is contained in:
ocornut
2025-01-24 19:27:50 +01:00
parent 4211fdc70b
commit 8a1613a382
7 changed files with 38 additions and 21 deletions

View File

@@ -16184,9 +16184,13 @@ void ImGui::DebugNodeFont(ImFont* font)
Text("Texture Area: about %d px ~%dx%d px", font->MetricsTotalSurface, surface_sqrt, surface_sqrt);
for (int config_i = 0; config_i < font->ConfigDataCount; config_i++)
if (font->ConfigData)
if (const ImFontConfig* cfg = &font->ConfigData[config_i])
BulletText("Input %d: \'%s\', Oversample: (%d,%d), PixelSnapH: %d, Offset: (%.1f,%.1f)",
config_i, cfg->Name, cfg->OversampleH, cfg->OversampleV, cfg->PixelSnapH, cfg->GlyphOffset.x, cfg->GlyphOffset.y);
{
const ImFontConfig* cfg = &font->ConfigData[config_i];
int oversample_h, oversample_v;
ImFontAtlasBuildGetOversampleFactors(cfg, &oversample_h, &oversample_v);
BulletText("Input %d: \'%s\', Oversample: (%d=>%d,%d=>%d), PixelSnapH: %d, Offset: (%.1f,%.1f)",
config_i, cfg->Name, cfg->OversampleH, oversample_h, cfg->OversampleV, oversample_v, cfg->PixelSnapH, cfg->GlyphOffset.x, cfg->GlyphOffset.y);
}
// Display all glyphs of the fonts in separate pages of 256 characters
{