]> git.localhorst.tv Git - blank.git/blobdiff - src/graphics/Font.hpp
glm backwards compatibility
[blank.git] / src / graphics / Font.hpp
index 2219452b86f8b71a11737402e508db5c2c802e4f..d52d43f63e179df4539d4687f50d30609815e6cd 100644 (file)
@@ -1,8 +1,9 @@
 #ifndef BLANK_GRAPHICS_FONT_HPP_
 #define BLANK_GRAPHICS_FONT_HPP_
 
+#include "glm.hpp"
+
 #include <SDL_ttf.h>
-#include <glm/glm.hpp>
 
 
 namespace blank {
@@ -11,6 +12,21 @@ class Texture;
 
 class Font {
 
+public:
+       enum FontStyle {
+               STYLE_NORMAL = TTF_STYLE_NORMAL,
+               STYLE_BOLD = TTF_STYLE_BOLD,
+               STYLE_ITALIC = TTF_STYLE_ITALIC,
+               STYLE_UNDERLINE = TTF_STYLE_UNDERLINE,
+               STYLE_STRIKE = TTF_STYLE_STRIKETHROUGH,
+       };
+       enum FontHinting {
+               HINT_NORMAL = TTF_HINTING_NORMAL,
+               HINT_LIGHT = TTF_HINTING_LIGHT,
+               HINT_MONO = TTF_HINTING_MONO,
+               HINT_NONE = TTF_HINTING_NONE,
+       };
+
 public:
        Font(const char *src, int size, long index = 0);
        ~Font();
@@ -22,6 +38,13 @@ public:
        Font &operator =(const Font &) = delete;
 
 public:
+       int Style() const noexcept;
+       void Style(int) const noexcept;
+       int Outline() const noexcept;
+       void Outline(int) noexcept;
+
+       int Hinting() const noexcept;
+       void Hinting(int) const noexcept;
        bool Kerning() const noexcept;
        void Kerning(bool) noexcept;
 
@@ -30,11 +53,15 @@ public:
        int Descent() const noexcept;
        int LineSkip() const noexcept;
 
+       const char *FamilyName() const noexcept;
+       const char *StyleName() const noexcept;
+
        bool HasGlyph(Uint16) const noexcept;
 
-       glm::tvec2<int> TextSize(const char *) const;
+       glm::ivec2 TextSize(const char *) const;
 
-       Texture Render(const char *, SDL_Color) const;
+       Texture Render(const char *) const;
+       void Render(const char *, Texture &) const;
 
 private:
        TTF_Font *handle;