Fonts: adding ImFontHooks for codepoint remapping.

This commit is contained in:
ocornut
2025-05-08 17:35:20 +02:00
parent 8523cbdf58
commit 89e880dfd1
3 changed files with 28 additions and 3 deletions

View File

@@ -37,7 +37,7 @@ Index of this file:
// [SECTION] Tab bar, Tab item support
// [SECTION] Table support
// [SECTION] ImGui internal API
// [SECTION] ImFontLoader
// [SECTION] ImFontLoader, ImFontHooks
// [SECTION] ImFontAtlas internal API
// [SECTION] Test Engine specific hooks (imgui_test_engine)
@@ -3664,7 +3664,7 @@ namespace ImGui
//-----------------------------------------------------------------------------
// [SECTION] ImFontLoader
// [SECTION] ImFontLoader, ImFontHooks
//-----------------------------------------------------------------------------
// Hooks and storage for a given font backend.
@@ -3693,6 +3693,14 @@ struct ImFontLoader
IMGUI_API const ImFontLoader* ImFontAtlasGetFontLoaderForStbTruetype();
#endif
// User hooks
// Conceptually this could be public, but API is still going to be evolve.
struct ImFontHooks
{
// Modify codepoint to map to another value.
void (*FontHookRemapCodepoint)(ImFontAtlas* atlas, ImFont* font, ImWchar* io_codepoint);
};
//-----------------------------------------------------------------------------
// [SECTION] ImFontAtlas internal API
//-----------------------------------------------------------------------------