diff --git a/imgui_internal.h b/imgui_internal.h index de68b9b3b..b1d8774ce 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -3699,6 +3699,9 @@ struct ImFontLoader #ifdef IMGUI_ENABLE_STB_TRUETYPE IMGUI_API const ImFontLoader* ImFontAtlasGetFontLoaderForStbTruetype(); #endif +#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS +typedef ImFontLoader ImFontBuilderIO; // [renamed/changed in 1.92] The types are not actually compatible but we provide this as a compile-time error report helper. +#endif //----------------------------------------------------------------------------- // [SECTION] ImFontAtlas internal API diff --git a/misc/freetype/imgui_freetype.h b/misc/freetype/imgui_freetype.h index b4e9ba1fd..2b4810e32 100644 --- a/misc/freetype/imgui_freetype.h +++ b/misc/freetype/imgui_freetype.h @@ -6,7 +6,9 @@ #ifndef IMGUI_DISABLE // Usage: -// - Add '#define IMGUI_ENABLE_FREETYPE' in your imconfig to enable support for imgui_freetype in imgui. +// - Add '#define IMGUI_ENABLE_FREETYPE' in your imconfig to automatically enable support +// for imgui_freetype in imgui. It is equivalent to selecting the default loader with: +// io.Fonts.FontLoader = ImGuiFreeType::GetFontLoader() // Optional support for OpenType SVG fonts: // - Add '#define IMGUI_ENABLE_FREETYPE_PLUTOSVG' to use plutosvg (not provided). See #7927. @@ -52,8 +54,9 @@ namespace ImGuiFreeType // Display UI to edit FontBuilderFlags in ImFontAtlas (shared) or ImFontConfig (single source) IMGUI_API bool DebugEditFontBuilderFlags(unsigned int* p_font_loader_flags); - // Obsolete names (will be removed soon) + // Obsolete names (will be removed) #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS + //IMGUI_API const ImFontBuilderIO* GetBuilderForFreeType(); // Renamed/changed in 1.92. Change 'io.Fonts->FontBuilderIO = ImGuiFreeType::GetBuilderForFreeType()' to 'io.Fonts.FontLoader = ImGuiFreeType::GetFontLoader()' if you need runtime selection. //static inline bool BuildFontAtlas(ImFontAtlas* atlas, unsigned int flags = 0) { atlas->FontBuilderIO = GetBuilderForFreeType(); atlas->FontBuilderFlags = flags; return atlas->Build(); } // Prefer using '#define IMGUI_ENABLE_FREETYPE' #endif }