1.1 --- a/src/ascension/ui/font.h Thu Apr 18 21:53:53 2024 +0200 1.2 +++ b/src/ascension/ui/font.h Thu Apr 18 22:53:55 2024 +0200 1.3 @@ -52,43 +52,25 @@ 1.4 */ 1.5 int size; 1.6 /** 1.7 + * TODO: remove from public struct 1.8 * Pointer to the SDL TTF font structure. 1.9 */ 1.10 TTF_Font *ptr; 1.11 } AscFont; 1.12 1.13 /** 1.14 - * Loads a font with the given style and size. 1.15 + * Activates a font with the given style and size. 1.16 * 1.17 - * The font is cached and returned faster the next time you call this 1.18 + * The font is cached and activated faster the next time you call this 1.19 * function with the same arguments. However, when you reach the maximum 1.20 * number of fonts, the cache is completely cleared and rebuilt. 1.21 * 1.22 * That means in general, that you should not be using too many fonts of 1.23 - * different sizes at the same time, and you should not keep the pointer 1.24 - * returned by this function too long, because you would risking cache misses. 1.25 + * different sizes at the same time. 1.26 * 1.27 * @param style the style 1.28 * @param size the point size 1.29 - * @return a pointer to the font structure (do not free) 1.30 */ 1.31 -AscFont const *asc_font(enum AscFontStyle style, int size); 1.32 - 1.33 -/** 1.34 - * Unloads all cached fonts from the context. 1.35 - */ 1.36 -void asc_font_cache_clear(void); 1.37 - 1.38 -/** 1.39 - * Checks, if the font is still loaded and reloads it, if required. 1.40 - * 1.41 - * There is no need to call this function manually. Every Ascension function 1.42 - * that you pass a font will do that for you and use the returned pointer in 1.43 - * case of a cache miss. 1.44 - * 1.45 - * @param font the font to validate 1.46 - * @return \p font, or a pointer to the new location of the loaded font 1.47 - */ 1.48 -AscFont const *asc_font_cache_validate(AscFont const *font); 1.49 +void asc_font(enum AscFontStyle style, int size); 1.50 1.51 #endif //ASCENSION_FONT_H