mirror of
https://github.com/ocornut/imgui.git
synced 2025-09-05 19:08:19 +00:00
Fonts: fixed legacy backend path preloading all sources sizes erroneously + failing to use ellipsis.
This commit is contained in:
@@ -3383,16 +3383,22 @@ void ImFontAtlasBuildPreloadAllGlyphRanges(ImFontAtlas* atlas)
|
||||
{
|
||||
atlas->Builder->PreloadedAllGlyphsRanges = true;
|
||||
for (ImFont* font : atlas->Fonts)
|
||||
{
|
||||
ImFontConfig* src = &font->Sources[0];
|
||||
ImFontBaked* baked = font->GetFontBaked(src->SizePixels);
|
||||
if (font->FallbackChar != 0)
|
||||
baked->FindGlyph(font->FallbackChar);
|
||||
if (font->EllipsisChar != 0)
|
||||
baked->FindGlyph(font->EllipsisChar);
|
||||
for (int src_n = 0; src_n < font->SourcesCount; src_n++)
|
||||
{
|
||||
ImFontConfig* src = &font->Sources[src_n];
|
||||
ImFontBaked* baked = font->GetFontBaked(src->SizePixels);
|
||||
src = &font->Sources[src_n];
|
||||
const ImWchar* ranges = src->GlyphRanges ? src->GlyphRanges : atlas->GetGlyphRangesDefault();
|
||||
IM_ASSERT(ranges != NULL);
|
||||
for (; ranges[0]; ranges += 2)
|
||||
for (unsigned int c = ranges[0]; c <= ranges[1] && c <= IM_UNICODE_CODEPOINT_MAX; c++) //-V560
|
||||
baked->FindGlyph((ImWchar)c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ImFontAtlasBuildUpdatePointers(ImFontAtlas* atlas)
|
||||
|
Reference in New Issue
Block a user