From e7cedffde2a521476d1778c541a6dbfcc39734ed Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 15 Apr 2024 16:42:37 -0500 Subject: [PATCH] fix FreeType font advance when hinting is off --- extern/imgui_patched/misc/freetype/imgui_freetype.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/imgui_patched/misc/freetype/imgui_freetype.cpp b/extern/imgui_patched/misc/freetype/imgui_freetype.cpp index 524d85735..570d61a3a 100644 --- a/extern/imgui_patched/misc/freetype/imgui_freetype.cpp +++ b/extern/imgui_patched/misc/freetype/imgui_freetype.cpp @@ -298,7 +298,7 @@ namespace out_glyph_info->Height = (int)ft_bitmap->rows; out_glyph_info->OffsetX = Face->glyph->bitmap_left; out_glyph_info->OffsetY = -Face->glyph->bitmap_top; - out_glyph_info->AdvanceX = (float)FT_CEIL(slot->advance.x); + out_glyph_info->AdvanceX = (float)FT_CEIL(slot->advance.x-((LoadFlags&FT_LOAD_NO_HINTING)?31:0)); out_glyph_info->IsColored = (ft_bitmap->pixel_mode == FT_PIXEL_MODE_BGRA); return ft_bitmap;