Fonts

Defines

TNT_FONTS_ASSETS_CACHE_INL
namespace tnt

Typedefs

template<unsigned I>
using font_cache = asset_cache<TTF_Font, I>
using small_font_cache = font_cache<10>
using medium_font_cache = font_cache<50>
using large_font_cache = font_cache<100>
template<unsigned I>
class asset_cache<TTF_Font, I>

Public Functions

~asset_cache() noexcept
TTF_Font *get(std::string_view path, int size)
void load(std::string_view path, int size)
void remove(std::string_view path)

Private Members

std::byte memory[I * sizeof(TTF_Font*)]
std::pmr::monotonic_buffer_resource res = {memory, sizeof(memory)}
std::pmr::unordered_map<std::string, TTF_Font*> cache = {&res}