36 _font = TTF_OpenFont(_path.c_str(),
static_cast<int>(_size));
38 std::cerr <<
"Failed to load font: " << TTF_GetError() << std::endl;
47 return _font !=
nullptr;
51 TTF_Font *
handle(
unsigned size)
const {
52 if (_font && size != _size) {
53 TTF_SetFontSize(_font,
static_cast<int>(size));
61 TTF_Font *_font =
nullptr;
64 mutable unsigned _size = 24;
Une police ouverte a une taille donnee.
Definition SdlFont.hpp:32
~SdlFont()
Definition SdlFont.hpp:41
bool isReady() const override
Definition SdlFont.hpp:46
TTF_Font * handle(unsigned size) const
La police, recalee sur size si besoin.
Definition SdlFont.hpp:51
SdlFont(std::string path)
Definition SdlFont.hpp:35