From c6548d5ad1ad8ce5a11b47b3eca418f75d70fa32 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 24 May 2025 21:59:21 +0200 Subject: [PATCH] fix: Non-subpixel rendered glyphs appearing as white rectangles if subpixel rendering is enabled --- plugins/fonts/source/font_loader.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/fonts/source/font_loader.cpp b/plugins/fonts/source/font_loader.cpp index ff0973b53..1fcb9ebeb 100644 --- a/plugins/fonts/source/font_loader.cpp +++ b/plugins/fonts/source/font_loader.cpp @@ -97,6 +97,7 @@ namespace hex::fonts { fontAtlas->getAtlas()->FontBuilderFlags |= ImGuiFreeTypeBuilderFlags_SubPixel; if (!fontAtlas->build()) return false; + ImU8 *tex_pixels_ch = nullptr; ImS32 tex_width; @@ -122,6 +123,13 @@ namespace hex::fonts { } } } + + for (i64 i = 0; i < tex_width * tex_height; i++) { + if (tex_pixels[i] == 0x00FFFFFF) { + tex_pixels[i] = 0x00000000; + } + } + if (ft != nullptr) { FT_Done_FreeType(ft); ft = nullptr;