29#include <SDL2pp/Optional.hh>
30#include <SDL2pp/Point.hh>
31#include <SDL2pp/Surface.hh>
32#include <SDL2pp/Export.hh>
63 explicit Font(TTF_Font* font);
78 Font(
const std::string& file,
int ptsize,
long index = 0);
93 Font(
RWops& rwops,
int ptsize,
long index = 0);
124 Font& operator=(
Font&& other)
noexcept;
153 TTF_Font* Get()
const;
169 int GetStyle()
const;
203 Font& SetStyle(
int style = TTF_STYLE_NORMAL);
213 int GetOutline()
const;
230 Font& SetOutline(
int outline = 0);
247 int GetHinting()
const;
270 Font& SetHinting(
int hinting = TTF_HINTING_NORMAL);
281 bool GetKerning()
const;
301 Font& SetKerning(
bool allowed =
true);
322 int GetHeight()
const;
342 int GetAscent()
const;
363 int GetDescent()
const;
375 int GetLineSkip()
const;
395 long GetNumFaces()
const;
414 bool IsFixedWidth()
const;
426 Optional<std::string> GetFamilyName()
const;
438 Optional<std::string> GetStyleName()
const;
455 int IsGlyphProvided(Uint16 ch)
const;
473 void GetGlyphMetrics(Uint16 ch,
int& minx,
int& maxx,
int& miny,
int& maxy,
int& advance)
const;
488 Rect GetGlyphRect(Uint16 ch)
const;
503 int GetGlyphAdvance(Uint16 ch)
const;
526 Point GetSizeText(
const std::string& text)
const;
544 Point GetSizeUTF8(
const std::string& text)
const;
562 Point GetSizeUNICODE(
const Uint16* text)
const;
580 Point GetSizeUNICODE(
const std::u16string& text)
const;
600 Surface RenderText_Solid(
const std::string& text, SDL_Color fg);
615 Surface RenderUTF8_Solid(
const std::string& text, SDL_Color fg);
630 Surface RenderUNICODE_Solid(
const Uint16* text, SDL_Color fg);
645 Surface RenderUNICODE_Solid(
const std::u16string& text, SDL_Color fg);
660 Surface RenderGlyph_Solid(Uint16 ch, SDL_Color fg);
681 Surface RenderText_Shaded(
const std::string& text, SDL_Color fg, SDL_Color bg);
697 Surface RenderUTF8_Shaded(
const std::string& text, SDL_Color fg, SDL_Color bg);
713 Surface RenderUNICODE_Shaded(
const Uint16* text, SDL_Color fg, SDL_Color bg);
729 Surface RenderUNICODE_Shaded(
const std::u16string& text, SDL_Color fg, SDL_Color bg);
745 Surface RenderGlyph_Shaded(Uint16 ch, SDL_Color fg, SDL_Color bg);
765 Surface RenderText_Blended(
const std::string& text, SDL_Color fg);
780 Surface RenderUTF8_Blended(
const std::string& text, SDL_Color fg);
795 Surface RenderUNICODE_Blended(
const Uint16* text, SDL_Color fg);
810 Surface RenderUNICODE_Blended(
const std::u16string& text, SDL_Color fg);
825 Surface RenderGlyph_Blended(Uint16 ch, SDL_Color fg);
Holder of a loaded font.
Definition: Font.hh:48
Font(const Font &)=delete
Deleted copy constructor.
Font & operator=(const Font &)=delete
Deleted assignment operator.
2D point
Definition: Point.hh:51
I/O abstraction.
Definition: RWops.hh:156
2D rectangle
Definition: Rect.hh:50
Image stored in system memory with direct access to pixel data.
Definition: Surface.hh:53