From 7837b9dc063014be08b90c4c2f59fe7adcd7c571 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 3 Oct 2022 17:59:36 +0200 Subject: [PATCH] Update raygui.h --- src/raygui.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/raygui.h b/src/raygui.h index afd9919..f07ca69 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -3548,7 +3548,18 @@ void GuiLoadStyleDefault(void) GuiSetStyle(COLORPICKER, HUEBAR_SELECTOR_HEIGHT, 8); GuiSetStyle(COLORPICKER, HUEBAR_SELECTOR_OVERFLOW, 2); - guiFont = GetFontDefault(); // Initialize default font + if (guiFont.texture.id != GetFontDefault().texture.id) + { + // Unload previous font texture + UnloadTexture(guiFont.texture); + + // Setup default raylib font + guiFont = GetFontDefault(); + + // Setup default raylib font rectangle + Rectangle whiteChar = { 41, 46, 2, 8 }; + SetShapesTexture(guiFont.texture, whiteChar); + } } // Get text with icon id prepended