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:
parent
57a93e1a19
commit
4ef1145241
2 changed files with 6 additions and 4 deletions
|
|
@ -45,6 +45,8 @@ Other changes:
|
|||
|
||||
- Fonts: added ImFontAtlas::SetFontLoader() to dynamically change font
|
||||
loader at runtime without using internal API. (#8752, #8465)
|
||||
- Fonts: fixed a bug where dynamically changing font loader would lose
|
||||
the Fallback and Ellipsis glyphs under some circumstance. (#8763)
|
||||
- Fonts: for large size fonts, layout/size calculation only load glyphs metrics.
|
||||
Actual glyphs are renderer+packed when used by drawing functions. (#8758, #8465)
|
||||
- Fonts: set a maximum font size of 512.0f at ImGui:: API level to reduce
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue