44 std::swap(font, other.font);
51 [[nodiscard]]
bool empty()
const {
return font ==
nullptr; }
71 [[nodiscard]]
unsigned getWidth()
const;
Wrapper around a SDL_Surface.
TTFFont & operator=(const TTFFont &)=delete
bool empty() const
Is this an empty font? (a default constructed object).
unsigned getWidth() const
Return the width of the font.
TTFFont(TTFFont &&other) noexcept
Move construct.
TTFFont & operator=(TTFFont &&other) noexcept
Move assignment.
bool isFixedWidth() const
Returns true iff this is a fixed-with (=mono-spaced) font.
SDLSurfacePtr render(std::string text, byte r, byte g, byte b) const
Render the given text to a new SDL_Surface.
unsigned getHeight() const
Return the height of the font.
gl::ivec2 getSize(zstring_view text) const
Return the size in pixels of the text if it would be rendered.
TTFFont()=default
Construct an empty font.
TTFFont(const TTFFont &)=delete
Like std::string_view, but with the extra guarantee that it refers to a zero-terminated string.
This file implemented 3 utility functions:
constexpr const char *const filename