X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=src%2Fgraphics%2FFont.hpp;h=1d4ff17f619823b14efabe3fa8ac6a1a1452bee6;hb=55dbd6b35a39888f245e247d2e140f141f918178;hp=2219452b86f8b71a11737402e508db5c2c802e4f;hpb=282d731ea8f10342efa82012028de7043b3dd639;p=blank.git diff --git a/src/graphics/Font.hpp b/src/graphics/Font.hpp index 2219452..1d4ff17 100644 --- a/src/graphics/Font.hpp +++ b/src/graphics/Font.hpp @@ -11,6 +11,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 +37,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 +52,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 TextSize(const char *) const; Texture Render(const char *, SDL_Color) const; + void Render(const char *, SDL_Color, Texture &) const; private: TTF_Font *handle;