aboutsummaryrefslogtreecommitdiffstats
path: root/include/font.hpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2017-09-22 08:47:14 -0400
committerClyne Sullivan <tullivan99@gmail.com>2017-09-22 08:47:14 -0400
commit19b2b1dde25885ada99deefe79266c2e22376e85 (patch)
treea5bf9c56f468663b78ce109d89b853637236574c /include/font.hpp
parent8720f1f253b55fa5233626dd854671a5925d65de (diff)
new font; dialog box word wrap... finally
Diffstat (limited to 'include/font.hpp')
-rw-r--r--include/font.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/font.hpp b/include/font.hpp
index 0a6e38b..20d27be 100644
--- a/include/font.hpp
+++ b/include/font.hpp
@@ -51,6 +51,9 @@ public:
FT_Done_FreeType(ftLibrary);
}
+ constexpr static inline int SizeSmall = 16;
+ constexpr static inline int SizeLarge = 24;
+
static void init(const std::string& ttf);
static void setFontSize(int size);
static void setFontColor(float r, float g, float b);
@@ -65,6 +68,9 @@ public:
static inline auto& getFont(void)
{ return fontData.at(currentSize); }
+
+ static inline auto getCharWidth(char c)
+ { return fontData.at(currentSize)[c - 33].wh.x; }
};
#endif // FONT_HPP_