From 4fb2b73a1558797afb96ed601947baf60da2ba44 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 26 Jan 2020 12:55:14 +0100 Subject: [PATCH] Addressed issue #66 NOTE: GetDirectoryPath() has also been updated in raylib, latest master branch version must be used! --- src/raygui.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/raygui.h b/src/raygui.h index 4ead043..0c2b5c3 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -804,6 +804,11 @@ void GuiSetFont(Font font) { if (font.texture.id > 0) { + // NOTE: If we try to setup a font but default style has not been + // lazily loaded before, it will be overwritten, so we need to force + // default style loading first + if (!guiStyleLoaded) GuiLoadStyleDefault(); + guiFont = font; GuiSetStyle(DEFAULT, TEXT_SIZE, font.baseSize); }