1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-09 23:54:20 +00:00

Fonts: fixed dynamically changing font loader from losing Fallback and Ellipsis glyphs. (#8763)

Only the call to ImFontAtlasBuildSetupFontLoader() is the notable change. The change in ImFontAtlasFontInitOutput() is merely to use an existing helper function.
This commit is contained in:
ocornut 2025-07-07 16:50:50 +02:00
parent 57a93e1a19
commit 4ef1145241
2 changed files with 6 additions and 4 deletions

View file

@ -3410,6 +3410,9 @@ void ImFontAtlasBuildSetupFontLoader(ImFontAtlas* atlas, const ImFontLoader* fon
atlas->FontLoader->LoaderInit(atlas);
for (ImFont* font : atlas->Fonts)
ImFontAtlasFontInitOutput(atlas, font);
for (ImFont* font : atlas->Fonts)
for (ImFontConfig* src : font->Sources)
ImFontAtlasFontSourceAddToFont(atlas, font, src);
}
// Preload all glyph ranges for legacy backends.
@ -3576,11 +3579,8 @@ bool ImFontAtlasFontInitOutput(ImFontAtlas* atlas, ImFont* font)
{
bool ret = true;
for (ImFontConfig* src : font->Sources)
{
const ImFontLoader* loader = src->FontLoader ? src->FontLoader : atlas->FontLoader;
if (loader && loader->FontSrcInit != NULL && !loader->FontSrcInit(atlas, src))
if (!ImFontAtlasFontSourceInit(atlas, src))
ret = false;
}
IM_ASSERT(ret); // Unclear how to react to this meaningfully. Assume that result will be same as initial AddFont() call.
return ret;
}