lv_binfont_loader.h

API reference for lv_binfont_loader.h

Report on GitHub

Functions

lv_binfont_create

Loads a lv_font_t object from a binary font file

 
lv_font_t * lv_binfont_create(const char *path)
Parameters
NameTypeDescription
pathconst char *path to font file

Returns: lv_font_t * — pointer to font where to load

lv_binfont_create_ex

Loads a lv_font_t object from a binary font file with additional options.

 
lv_font_t * lv_binfont_create_ex(const lv_binfont_dsc_t *dsc)
Parameters
NameTypeDescription
dscconst lv_binfont_dsc_t *describes the font source and how to load it

Returns: lv_font_t * — pointer to the loaded font or NULL on error

lv_binfont_create_from_buffer

Loads a lv_font_t object from a memory buffer containing the binary font file. Requires LV_USE_FS_MEMFS

 
lv_font_t * lv_binfont_create_from_buffer(void *buffer, uint32_t size)
Parameters
NameTypeDescription
buffervoid *address of the font file in the memory
sizeuint32_tsize of the font file buffer

Returns: lv_font_t * — pointer to font where to load

lv_binfont_destroy

Frees the memory allocated by the lv_binfont_create() function

 
void lv_binfont_destroy(lv_font_t *font)
Parameters
NameTypeDescription
fontlv_font_t *lv_font_t object created by the lv_binfont_create function May be NULL.

Structs

struct

lv_binfont_font_src_t

MemberTypeDescription
font_sizeuint32_tSize of the font in pixels
pathconst char *Path to font file
bufferconst void *Address of the font file in the memory
buffer_sizeuint32_tSize of the font file buffer
dynamic_glyph_loadboolLoad the glyph bitmaps on demand. See lv_binfont_dsc_t
struct

lv_binfont_dsc_t

Describes how a binary font should be loaded

MemberTypeDescription
pathconst char *Path to the font file. If NULL the font is loaded from buffer.
bufferconst void *Address of the font file in the memory. Used only if path is NULL. Requires LV_USE_FS_MEMFS.
buffer_sizeuint32_tSize of the font file buffer
dynamic_glyph_loadboolif true the glyph bitmaps are not loaded into RAM when the font is created, instead the glyph is loaded from the file during rendering when the glyph is drawn
Used by 1 function
  • lv_binfont_create_ex — param dsc

Variables

lv_binfont_font_class

 
const lv_font_class_t lv_binfont_font_class

Dependencies

Indirect dependencies

Last updated on

On this page