diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 4bde225d6..b208b6836 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -3368,7 +3368,7 @@ void ImFontAtlasBuildMain(ImFontAtlas* atlas) // [LEGACY] For backends not supporting RendererHasTextures: preload all glyphs ImFontAtlasBuildUpdateRendererHasTexturesFromContext(atlas); if (atlas->RendererHasTextures == false) // ~ImGuiBackendFlags_RendererHasTextures - ImFontAtlasBuildPreloadAllGlyphRanges(atlas); + ImFontAtlasBuildLegacyPreloadAllGlyphRanges(atlas); atlas->TexIsBuilt = true; } @@ -3405,12 +3405,12 @@ void ImFontAtlasBuildSetupFontLoader(ImFontAtlas* atlas, const ImFontLoader* fon // Preload all glyph ranges for legacy backends. // This may lead to multiple texture creation which might be a little slower than before. -void ImFontAtlasBuildPreloadAllGlyphRanges(ImFontAtlas* atlas) +void ImFontAtlasBuildLegacyPreloadAllGlyphRanges(ImFontAtlas* atlas) { atlas->Builder->PreloadedAllGlyphsRanges = true; for (ImFont* font : atlas->Fonts) { - ImFontBaked* baked = font->GetFontBaked(font->Sources[0]->SizePixels); + ImFontBaked* baked = font->GetFontBaked(font->LegacySize); if (font->FallbackChar != 0) baked->FindGlyph(font->FallbackChar); if (font->EllipsisChar != 0) diff --git a/imgui_internal.h b/imgui_internal.h index e344cbccf..b80bf50b6 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -3807,7 +3807,7 @@ IMGUI_API void ImFontAtlasTextureCompact(ImFontAtlas* atlas); IMGUI_API ImVec2i ImFontAtlasTextureGetSizeEstimate(ImFontAtlas* atlas); IMGUI_API void ImFontAtlasBuildSetupFontSpecialGlyphs(ImFontAtlas* atlas, ImFont* font, ImFontConfig* src); -IMGUI_API void ImFontAtlasBuildPreloadAllGlyphRanges(ImFontAtlas* atlas); // Legacy +IMGUI_API void ImFontAtlasBuildLegacyPreloadAllGlyphRanges(ImFontAtlas* atlas); // Legacy IMGUI_API void ImFontAtlasBuildGetOversampleFactors(ImFontConfig* src, ImFontBaked* baked, int* out_oversample_h, int* out_oversample_v); IMGUI_API void ImFontAtlasBuildDiscardBakes(ImFontAtlas* atlas, int unused_frames);