From 1e03d3843fec67f313b285ec987ced90a17aba39 Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Sun, 29 Jul 2018 23:52:43 +0300 Subject: [PATCH] font stringSize load --- src/detail/font.cpp | 2 ++ src/font.cpp | 2 ++ 2 files changed, 4 insertions(+) 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); }