Skip to content

Commit 530e62f

Browse files
committed
add back setupuserfonts
Signed-off-by: Tomas Slusny <[email protected]>
1 parent 2148aaa commit 530e62f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Raylib.NET.ImGui/RlImGui.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ public static class RlImGui
2323
internal static bool IsAltDown() => Raylib.IsKeyDown((int)KeyboardKey.KEY_LEFT_ALT) || Raylib.IsKeyDown((int)KeyboardKey.KEY_RIGHT_ALT);
2424
internal static bool IsSuperDown() => Raylib.IsKeyDown((int)KeyboardKey.KEY_LEFT_SUPER) || Raylib.IsKeyDown((int)KeyboardKey.KEY_RIGHT_SUPER);
2525

26+
27+
public delegate void SetupUserFontsCallback(ImGuiIOPtr imGuiIo);
28+
29+
/// <summary>
30+
/// Callback for cases where the user wants to install additional fonts.
31+
/// </summary>
32+
public static SetupUserFontsCallback SetupUserFonts = null;
33+
2634
public static void Setup(bool darkTheme = true, bool enableDocking = false, bool addDefaultFont = true)
2735
{
2836
LastFrameFocused = Raylib.IsWindowFocused();
@@ -55,6 +63,8 @@ public static void Setup(bool darkTheme = true, bool enableDocking = false, bool
5563
if (addDefaultFont)
5664
fonts.AddFontDefault();
5765

66+
SetupUserFonts?.Invoke(io);
67+
5868
io.BackendFlags |= ImGuiBackendFlags.HasMouseCursors | ImGuiBackendFlags.HasSetMousePos | ImGuiBackendFlags.HasGamepad;
5969
io.MousePos.X = 0;
6070
io.MousePos.Y = 0;

0 commit comments

Comments
 (0)