1 /**
2  * @file lv_binfont_loader.h
3  *
4  */
5 
6 #ifndef LV_BINFONT_LOADER_H
7 #define LV_BINFONT_LOADER_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*********************
14  *      INCLUDES
15  *********************/
16 
17 /*********************
18  *      DEFINES
19  *********************/
20 
21 /**********************
22  *      TYPEDEFS
23  **********************/
24 
25 /**********************
26  * GLOBAL PROTOTYPES
27  **********************/
28 
29 /**
30  * Loads a `lv_font_t` object from a binary font file
31  * @param path   path to font file
32  * @return  pointer to font where to load
33  */
34 lv_font_t * lv_binfont_create(const char * path);
35 
36 #if LV_USE_FS_MEMFS
37 /**
38  * Loads a `lv_font_t` object from a memory buffer containing the binary font file.
39  * Requires LV_USE_FS_MEMFS
40  * @param buffer        address of the font file in the memory
41  * @param size          size of the font file buffer
42  * @return              pointer to font where to load
43  */
44 lv_font_t * lv_binfont_create_from_buffer(void * buffer, uint32_t size);
45 #endif
46 
47 /**
48  * Frees the memory allocated by the `lv_binfont_create()` function
49  * @param font          lv_font_t object created by the lv_binfont_create function
50  */
51 void lv_binfont_destroy(lv_font_t * font);
52 
53 /**********************
54  *      MACROS
55  **********************/
56 
57 #ifdef __cplusplus
58 } /*extern "C"*/
59 #endif
60 
61 #endif /* LV_BINFONT_LOADER_H */
62