28 #include "eng3d/ttf.hpp"
29 #include "eng3d/io.hpp"
30 #include "eng3d/string.hpp"
31 #include "eng3d/utils.hpp"
34 this->
sdl_font =
static_cast<void*
>(TTF_OpenFont(asset->get_abs_path().c_str(), dpi));
40 if(this->sdl_font !=
nullptr)
41 TTF_CloseFont(
static_cast<TTF_Font*
>(this->sdl_font));
59 const std::string path = asset.get() !=
nullptr ? asset->get_abs_path() :
"";
60 const auto it = this->fonts.find(path);
61 if(it != this->fonts.cend())
64 auto font = std::make_shared<Eng3D::TrueType::Font>(asset, 16);
65 this->fonts[path] = font;
66 return this->fonts[path];
std::shared_ptr< Eng3D::TrueType::Font > load(std::shared_ptr< Eng3D::IO::Asset::Base > asset)
std::string translate_format(const std::string_view format, Args &&... args)
String formatter, with translation.
#define CXX_THROW(class,...)