1 /**
2  * @file lv_tiny_ttf.h
3  *
4  */
5 
6 #ifndef LV_TINY_TTF_H
7 #define LV_TINY_TTF_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*********************
14  *      INCLUDES
15  *********************/
16 #include "../../lv_conf_internal.h"
17 
18 #if LV_USE_TINY_TTF
19 
20 /*********************
21  *      DEFINES
22  *********************/
23 
24 /**********************
25  *      TYPEDEFS
26  **********************/
27 
28 /**********************
29  * GLOBAL PROTOTYPES
30  **********************/
31 
32 #if LV_TINY_TTF_FILE_SUPPORT != 0
33 /**
34  * Create a font from the specified file or path with the specified line height.
35  * @param path        the path or file name of the font
36  * @param font_size   the font size in pixel
37  * @return a font object
38  */
39 lv_font_t * lv_tiny_ttf_create_file(const char * path, int32_t font_size);
40 
41 /**
42  * Create a font from the specified file or path with the specified line height with the specified cache size.
43  * @param path        the path or file name of the font
44  * @param font_size   the font size in pixel
45  * @param kerning     kerning value in pixel
46  * @param cache_size  the cache size in count
47  * @return a font object
48  */
49 lv_font_t * lv_tiny_ttf_create_file_ex(const char * path, int32_t font_size, lv_font_kerning_t kerning,
50                                        size_t cache_size);
51 #endif
52 
53 /**
54  * Create a font from the specified data pointer with the specified line height.
55  * @param data        the data pointer
56  * @param data_size   the data size
57  * @param font_size   the font size in pixel
58  * @return a font object
59  */
60 lv_font_t * lv_tiny_ttf_create_data(const void * data, size_t data_size, int32_t font_size);
61 
62 /**
63  * Create a font from the specified data pointer with the specified line height and the specified cache size.
64  * @param data        the data pointer
65  * @param data_size   the data size
66  * @param font_size   the font size in pixel
67  * @param kerning     kerning value in pixel
68  * @param cache_size  the cache size in count
69  * @return
70  */
71 lv_font_t * lv_tiny_ttf_create_data_ex(const void * data, size_t data_size, int32_t font_size,
72                                        lv_font_kerning_t kerning, size_t cache_size);
73 
74 /**
75  * Set the size of the font to a new font_size
76  * @note the font bitmap cache and glyph cache will be flushed.
77  * @param font        the font object
78  * @param font_size   the font size in pixel
79  */
80 void lv_tiny_ttf_set_size(lv_font_t * font, int32_t font_size);
81 
82 /**
83  * Destroy a font previously created with lv_tiny_ttf_create_xxxx()
84  * @param font        the font object
85  */
86 void lv_tiny_ttf_destroy(lv_font_t * font);
87 
88 /**********************
89  *      MACROS
90  **********************/
91 
92 #endif /*LV_USE_TINY_TTF*/
93 
94 #ifdef __cplusplus
95 } /*extern "C"*/
96 #endif
97 
98 #endif /*LV_TINY_TTF_H*/
99