Fonts: Basic heuristic to repack instead of growing. Moved rects count/surface to internals.

This commit is contained in:
ocornut
2025-01-13 17:56:36 +01:00
parent 2137b3448b
commit 8ed4e2dde7
4 changed files with 27 additions and 15 deletions

View File

@@ -15594,7 +15594,7 @@ static void MetricsHelpMarker(const char* desc)
}
#ifdef IMGUI_ENABLE_FREETYPE
namespace ImGuiFreeType { IMGUI_API const ImFontLoader* GetBackendIOForFreeType(); }
namespace ImGuiFreeType { IMGUI_API const ImFontLoader* GetFontLoader(); }
#endif
// [DEBUG] List fonts in a font atlas and display its texture
@@ -15628,7 +15628,7 @@ void ImGui::ShowFontAtlas(ImFontAtlas* atlas)
#endif
SameLine();
#ifdef IMGUI_ENABLE_FREETYPE
const ImFontLoader* loader_freetype = ImGuiFreeType::GetBackendIOForFreeType();
const ImFontLoader* loader_freetype = ImGuiFreeType::GetFontLoader();
if (RadioButton("FreeType", loader_current == loader_freetype))
ImFontAtlasBuildSetupFontLoader(atlas, loader_freetype);
#else