refactor(font_load): rename font_load to binfont_load

font_load was to generic
This commit is contained in:
Gabor Kiss-Vamosi
2023-11-14 08:48:28 +01:00
parent bc9139e97b
commit 51bc45f870
6 changed files with 33 additions and 32 deletions

View File

@@ -280,7 +280,7 @@ The built-in symbols are created from the `FontAwesome <https://fontawesome.com/
Load a font at run-time
***********************
:cpp:func:`lv_font_load` can be used to load a font from a file. The font needs
:cpp:func:`lv_binfont_load` can be used to load a font from a file. The font needs
to have a special binary format. (Not TTF or WOFF). Use
`lv_font_conv <https://github.com/lvgl/lv_font_conv/>`__ with the
``--format bin`` option to generate an LVGL compatible font file.
@@ -292,18 +292,19 @@ Example
.. code:: c
lv_font_t * my_font;
my_font = lv_font_load(X/path/to/my_font.bin);
static lv_font_t my_font;
lv_result_t res = lv_binfont_load(&my_font, "X:/path/to/my_font.bin");
if(res != LV_RESULT_OK) return;
/*Use the font*/
/*Free the font if not required anymore*/
lv_font_free(my_font);
lv_font_free(&my_font);
Load a font from a memory buffer at run-time
******************************************
:cpp:func:`lv_font_load_from_buffer` can be used to load a font from a memory buffer.
:cpp:func:`lv_binfont_load_from_buffer` can be used to load a font from a memory buffer.
This function may be useful to load a font from an external file system, which is not
supported by LVGL. The font needs to be in the same format as if it were loaded from a file.
@@ -314,7 +315,7 @@ Example
.. code:: c
lv_font_t * my_font;
static lv_font_t my_font;
uint8_t *buf;
uint32_t bufsize;
@@ -322,12 +323,12 @@ Example
...
/*Load font from the buffer*/
my_font = lv_font_load_from_buffer((void *)buf, buf));
lv_result_t res = lv_binfont_load_from_buffer(&my_font, (void *)buf, buf));
if(res != LV_RESULT_OK) return;
/*Use the font*/
/*Free the font if not required anymore*/
lv_font_free(my_font);
lv_font_free(&my_font);
Add a new font engine
*********************