Revert "Fonts: avoid baking ExtraSizeScale twice into Ascent/Descent."

This reverts commit 1bcc23ef12.
This commit is contained in:
ocornut
2026-02-10 17:56:37 +01:00
parent 5fe48b6a0e
commit c71b2a1fe6
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -451,7 +451,7 @@ static bool ImGui_ImplFreeType_FontBakedInit(ImFontAtlas* atlas, ImFontConfig* s
{
// Read metrics
FT_Size_Metrics metrics = bd_baked_data->FtSize->metrics;
const float scale = 1.0f / (rasterizer_density * src->ExtraSizeScale);
const float scale = 1.0f / rasterizer_density;
baked->Ascent = (float)FT_CEIL(metrics.ascender) * scale; // The pixel extents above the baseline in pixels (typically positive).
baked->Descent = (float)FT_CEIL(metrics.descender) * scale; // The extents below the baseline in pixels (typically negative).
//LineSpacing = (float)FT_CEIL(metrics.height) * scale; // The baseline-to-baseline distance. Note that it usually is larger than the sum of the ascender and descender taken as absolute values. There is also no guarantee that no glyphs extend above or below subsequent baselines when using this distance. Think of it as a value the designer of the font finds appropriate.