diff --git a/src/detail/font.cpp b/src/detail/font.cpp index 1c0bfb0..8b13391 100644 --- a/src/detail/font.cpp +++ b/src/detail/font.cpp @@ -48,6 +48,8 @@ void font::unload() void font::stringSize(const std::string &string, float *width, float *height) { + + float penX = 0; float size_x = 0; diff --git a/src/font.cpp b/src/font.cpp index 6d7cd36..93ca7e5 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -31,6 +31,8 @@ void font::unload() void font::stringSize(const std::string &string, float *width, float *height) { + if (!isLoaded()) + load(); auto &font = detail::font::get(handle); font.stringSize(string, width, height); }