5#ifndef INCLUDE_FIFECHAN_BACKENDS_SDL_SDLTRUETYPEFONT_HPP_
6#define INCLUDE_FIFECHAN_BACKENDS_SDL_SDLTRUETYPEFONT_HPP_
13#include "fifechan/platform.hpp"
16#include <SDL3_ttf/SDL_ttf.h>
19#include "fifechan/font.hpp"
99 int getWidth(std::string
const & text)
const override;
Font(Font const &)=default
Copy constructor.
Abstract interface providing primitive drawing functions (lines, rectangles, etc.).
virtual bool isAntiAlias()
Checks if anti aliasing is used.
int mGlyphSpacing
Additional spacing between glyphs in pixels.
int mRowSpacing
Additional spacing between rows in pixels.
int mHeight
Cached font height 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.
TTF_Font * mFont
Underlying TTF_Font pointer from SDL_ttf.
virtual void setAntiAlias(bool antiAlias)
Enable or disable anti-aliasing for rendered glyphs.
int getWidth(std::string const &text) const override
Gets the width of a string.
virtual int getRowSpacing()
Gets the spacing between rows in pixels.
void drawString(fcn::Graphics *graphics, std::string const &text, int x, int y) override
Draws a string.
bool mAntiAlias
Whether anti-aliasing is enabled for rendering.
virtual void setRowSpacing(int spacing)
Sets the spacing between rows in pixels.
TrueTypeFont(std::string const &filename, int size)
Constructor.
virtual int getGlyphSpacing()
Gets the spacing between letters in pixels.
int getHeight() const override
Gets the height of the glyphs in the font.