fix: Non-subpixel rendered glyphs appearing as white rectangles if subpixel rendering is enabled

This commit is contained in:
WerWolv 2025-05-24 21:59:21 +02:00
parent bd8c4e807c
commit c6548d5ad1
1 changed files with 8 additions and 0 deletions

View File

@ -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;