1 #ifndef LIBWTK_SDL2_FONT_WORD_CACHE_HPP 2 #define LIBWTK_SDL2_FONT_WORD_CACHE_HPP 7 #include <unordered_map> 10 #include <SDL2/SDL_ttf.h> 12 #include "copy_command.hpp" 14 #include "geometry.hpp" 15 #include "sdl_util.hpp" 30 std::size_t extra_spaces;
49 std::tuple<vec, std::vector<copy_command>> text(std::string t,
int max_line_width = -1);
51 vec text_size(std::string t,
int max_line_width = -1);
52 int text_minimum_width(std::string t);
54 unsigned int font_height()
const;
56 int font_line_skip()
const;
62 template <
typename BackInsertIt>
63 vec compute_text_layout(std::string t,
int max_line_width, BackInsertIt it);
65 int get_word_left_kerning(std::string
const & word);
66 int get_word_right_kerning(std::string
const & word);
69 vec texture_dim_nullptr(SDL_Texture * texture)
const;
72 SDL_Texture * word(std::string);
74 SDL_Renderer * _renderer;
75 std::unordered_map<std::string, SDL_Texture *> _prerendered;
Definition: font_word_cache.hpp:27
Definition: geometry.hpp:12
Definition: font_word_cache.hpp:33
Definition: font_word_cache.hpp:17
Definition: font_word_cache.hpp:22