X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FFont.hpp;fp=src%2Fgraphics%2FFont.hpp;h=2219452b86f8b71a11737402e508db5c2c802e4f;hb=282d731ea8f10342efa82012028de7043b3dd639;hp=0000000000000000000000000000000000000000;hpb=19dfd78d4269d56bd34ab72f6b701be9f84b9719;p=blank.git diff --git a/src/graphics/Font.hpp b/src/graphics/Font.hpp new file mode 100644 index 0000000..2219452 --- /dev/null +++ b/src/graphics/Font.hpp @@ -0,0 +1,46 @@ +#ifndef BLANK_GRAPHICS_FONT_HPP_ +#define BLANK_GRAPHICS_FONT_HPP_ + +#include +#include + + +namespace blank { + +class Texture; + +class Font { + +public: + Font(const char *src, int size, long index = 0); + ~Font(); + + Font(Font &&) noexcept; + Font &operator =(Font &&) noexcept; + + Font(const Font &) = delete; + Font &operator =(const Font &) = delete; + +public: + bool Kerning() const noexcept; + void Kerning(bool) noexcept; + + int Height() const noexcept; + int Ascent() const noexcept; + int Descent() const noexcept; + int LineSkip() const noexcept; + + bool HasGlyph(Uint16) const noexcept; + + glm::tvec2 TextSize(const char *) const; + + Texture Render(const char *, SDL_Color) const; + +private: + TTF_Font *handle; + +}; + +} + +#endif