Fonts: fixed handling of ImFontConfig::FontDataOwnedByAtlas = false which did erroneously make a copy of the font data. (#9086)
build / Build - Windows (push) Has been cancelled
build / Build - Linux (push) Has been cancelled
build / Build - MacOS (push) Has been cancelled
build / Build - iOS (push) Has been cancelled
build / Build - Emscripten (push) Has been cancelled
build / Build - Android (push) Has been cancelled
build / Test - Windows (push) Has been cancelled
build / Test - Linux (push) Has been cancelled
build / Test - MacOS (push) Has been cancelled

Amend 815168c7e
+ Added explicit casts for intent/clarity when passing to stb_truetype/freetype.
This commit is contained in:
ocornut
2025-11-24 15:39:41 +01:00
parent 5f82275ba1
commit 98636f4a23
3 changed files with 8 additions and 9 deletions
+1 -1
View File
@@ -174,7 +174,7 @@ struct ImGui_ImplFreeType_FontSrcBakedData
bool ImGui_ImplFreeType_FontSrcData::InitFont(FT_Library ft_library, ImFontConfig* src, ImGuiFreeTypeLoaderFlags extra_font_loader_flags)
{
FT_Error error = FT_New_Memory_Face(ft_library, (uint8_t*)src->FontData, (FT_Long)src->FontDataSize, (FT_Long)src->FontNo, &FtFace);
FT_Error error = FT_New_Memory_Face(ft_library, (const FT_Byte*)src->FontData, (FT_Long)src->FontDataSize, (FT_Long)src->FontNo, &FtFace);
if (error != 0)
return false;
error = FT_Select_Charmap(FtFace, FT_ENCODING_UNICODE);