lv_freetype.h
API reference for lv_freetype.h
See Also: Private HeaderThis header has a companion private implementation with internal data structures.lv_freetype_private.h
Functions
public/font/lv_freetype.h:130function
lv_freetype_outline_get_scale
Get the scale of a FreeType font.
uint32_t lv_freetype_outline_get_scale(const lv_font_t *font)| Name | Type | Description |
|---|---|---|
font | const lv_font_t * | The FreeType font to get the scale of. |
Returns: uint32_t — The scale of the FreeType font.
public/font/lv_freetype.h:76function
lv_freetype_init
Initialize the freetype library.
lv_result_t lv_freetype_init(uint32_t max_glyph_cnt)| Name | Type |
|---|---|
max_glyph_cnt | uint32_t |
Returns: lv_result_t — LV_RESULT_OK on success, otherwise LV_RESULT_INVALID.
public/font/lv_freetype.h:81function
lv_freetype_uninit
Uninitialize the freetype library
void lv_freetype_uninit(void)public/font/lv_freetype.h:87function
lv_freetype_init_font_info
Initialize a font info structure.
void lv_freetype_init_font_info(lv_font_info_t *font_info)| Name | Type | Description |
|---|---|---|
font_info | lv_font_info_t * | font info structure to be initialized. |
public/font/lv_freetype.h:94function
lv_freetype_font_create_with_info
Create a freetype font with a font info structure.
lv_font_t * lv_freetype_font_create_with_info(const lv_font_info_t *font_info)| Name | Type | Description |
|---|---|---|
font_info | const lv_font_info_t * | font info structure. |
Returns: lv_font_t * — Created font, or NULL on failure.
public/font/lv_freetype.h:104function
lv_freetype_font_create
Create a freetype font.
lv_font_t * lv_freetype_font_create(const char *pathname, lv_freetype_font_render_mode_t render_mode, uint32_t size, lv_freetype_font_style_t style)| Name | Type | Description |
|---|---|---|
pathname | const char * | font file path. |
render_mode | lv_freetype_font_render_mode_t | font render mode(see lv_freetype_font_render_mode_t for details). |
size | uint32_t | font size. |
style | lv_freetype_font_style_t | font style(see lv_freetype_font_style_t for details). |
Returns: lv_font_t * — Created font, or NULL on failure.
public/font/lv_freetype.h:113function
lv_freetype_font_delete
Delete a freetype font.
void lv_freetype_font_delete(lv_font_t *font)| Name | Type | Description |
|---|---|---|
font | lv_font_t * | freetype font to be deleted. May be NULL. |
public/font/lv_freetype.h:122function
lv_freetype_outline_add_event
Register a callback function to generate outlines for FreeType fonts.
void lv_freetype_outline_add_event(lv_event_cb_t event_cb, lv_event_code_t filter, void *user_data)| Name | Type | Description |
|---|---|---|
event_cb | lv_event_cb_t | The callback function to be registered. |
filter | lv_event_code_t | The event code to filter for, or LV_EVENT_ALL to receive every event. |
user_data | void * | User data to be passed to the callback function. May be NULL. |
public/font/lv_freetype.h:138function
lv_freetype_is_outline_font
Check if the font is an outline font.
bool lv_freetype_is_outline_font(const lv_font_t *font)| Name | Type | Description |
|---|---|---|
font | const lv_font_t * | The FreeType font. |
Returns: bool — Is outline font on success, otherwise false.
Enums
lv_freetype_font_style_t
| Name | Value |
|---|---|
LV_FREETYPE_FONT_STYLE_NORMAL | 0 |
LV_FREETYPE_FONT_STYLE_ITALIC | 1 << 0 |
LV_FREETYPE_FONT_STYLE_BOLD | 1 << 1 |
Used by 1 function
lv_freetype_font_create— paramstyle
lv_freetype_font_render_mode_t
| Name | Value |
|---|---|
LV_FREETYPE_FONT_RENDER_MODE_BITMAP | 0 |
LV_FREETYPE_FONT_RENDER_MODE_OUTLINE | 1 |
Used by 1 function
lv_freetype_font_create— paramrender_mode
lv_freetype_outline_type_t
| Name |
|---|
LV_FREETYPE_OUTLINE_END |
LV_FREETYPE_OUTLINE_MOVE_TO |
LV_FREETYPE_OUTLINE_LINE_TO |
LV_FREETYPE_OUTLINE_CUBIC_TO |
LV_FREETYPE_OUTLINE_CONIC_TO |
Typedefs
public/font/lv_freetype.h:46typedef
LV_FT_FONT_STYLE
typedef lv_freetype_font_style_t LV_FT_FONT_STYLEpublic/font/lv_freetype.h:53typedef
lv_freetype_outline_t
typedef void* lv_freetype_outline_tpublic/font/lv_freetype.h:64typedef
lv_freetype_font_src_t
typedef const char lv_freetype_font_src_tOnly path string is required
Macros
LV_FREETYPE_F26DOT6_TO_INT
#define LV_FREETYPE_F26DOT6_TO_INT(x) \
((x) >> 6)LV_FREETYPE_F26DOT6_TO_FLOAT
#define LV_FREETYPE_F26DOT6_TO_FLOAT(x) \
((float)(x) / 64)FT_FONT_STYLE_NORMAL
#define FT_FONT_STYLE_NORMAL LV_FREETYPE_FONT_STYLE_NORMALFT_FONT_STYLE_ITALIC
#define FT_FONT_STYLE_ITALIC LV_FREETYPE_FONT_STYLE_ITALICFT_FONT_STYLE_BOLD
#define FT_FONT_STYLE_BOLD LV_FREETYPE_FONT_STYLE_BOLDVariables
public/font/lv_freetype.h:66variable
lv_freetype_font_class
const lv_font_class_t lv_freetype_font_classDependencies
Indirect dependencies
Last updated on