5#ifndef INCLUDE_FIFECHAN_BACKENDS_SDL_SDLTRUETYPEFONT_HPP_
6#define INCLUDE_FIFECHAN_BACKENDS_SDL_SDLTRUETYPEFONT_HPP_
13#include "fifechan/font.hpp"
14#include "fifechan/platform.hpp"
93 int getWidth(std::string
const & text)
const override;
Abstract interface providing primitive drawing functions (lines, rectangles, etc.).
TrueTypeFont(std::string const &filename, int size)
Constructor.
int mRowSpacing
Additional spacing between rows in pixels.
void drawString(fcn::Graphics *graphics, std::string const &text, int x, int y) override
Draws a string.
TTF_Font * mFont
Underlying TTF_Font pointer from SDL_ttf.
int mGlyphSpacing
Additional spacing between glyphs in pixels.
std::string mFilename
Filename of the font used to create mFont.
virtual void setGlyphSpacing(int spacing)
Sets the spacing between letters in pixels.
int getWidth(std::string const &text) const override
Gets the width of a string.
virtual void setRowSpacing(int spacing)
Sets the spacing between rows in pixels.
int getHeight() const override
Gets the height of the glyphs in the font.
virtual bool isAntiAlias()
Checks if anti aliasing is used.
virtual int getGlyphSpacing()
Gets the spacing between letters in pixels.
virtual int getRowSpacing()
Gets the spacing between rows in pixels.
bool mAntiAlias
Whether anti-aliasing is enabled for rendering.
int mHeight
Cached font height in pixels.
virtual void setAntiAlias(bool antiAlias)
Enable or disable anti-aliasing for rendered glyphs.
Unified header for the SDL backend.