1 /**
2  * @file lv_font_manager_recycle.h
3  *
4  */
5 
6 #ifndef LV_FONT_MANAGER_RECYCLE_H
7 #define LV_FONT_MANAGER_RECYCLE_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*********************
14  *      INCLUDES
15  *********************/
16 
17 #include "lv_font_manager_utils.h"
18 
19 #if LV_USE_FONT_MANAGER
20 
21 /*********************
22  *      INCLUDES
23  *********************/
24 
25 /*********************
26  *      DEFINES
27  *********************/
28 
29 /**********************
30  *      TYPEDEFS
31  **********************/
32 
33 typedef struct _lv_font_manager_recycle_t lv_font_manager_recycle_t;
34 
35 /**********************
36  * GLOBAL PROTOTYPES
37  **********************/
38 
39 /**
40  * Create font recycle manager.
41  * @param max_size recycle size.
42  * @return pointer to font recycle manager.
43  */
44 lv_font_manager_recycle_t * lv_font_manager_recycle_create(uint32_t max_size);
45 
46 /**
47  * Delete font recycle manager.
48  * @param manager pointer to font recycle manager.
49  */
50 void lv_font_manager_recycle_delete(lv_font_manager_recycle_t * manager);
51 
52 /**
53  * Get a reusable font.
54  * @param manager pointer to font recycle manager.
55  * @param ft_info font info.
56  * @return returns true on success.
57  */
58 lv_font_t * lv_font_manager_recycle_get_reuse(lv_font_manager_recycle_t * manager, const lv_freetype_info_t * ft_info);
59 
60 /**
61  * Set fonts to be reused.
62  * @param manager pointer to font recycle manager.
63  * @param ft_info font info.
64  */
65 void lv_font_manager_recycle_set_reuse(lv_font_manager_recycle_t * manager, lv_font_t * font,
66                                        const lv_freetype_info_t * ft_info);
67 
68 /**********************
69  *      MACROS
70  **********************/
71 
72 #endif /* LV_USE_FONT_MANAGER */
73 
74 #ifdef __cplusplus
75 } /*extern "C"*/
76 #endif
77 
78 #endif /* LV_FONT_MANAGER_RECYCLE_H */
79