lv_draw_label.h

API reference for lv_draw_label.h

Report on GitHub
See Also: Private HeaderThis header has a companion private implementation with internal data structures.lv_draw_label_private.h

Functions

lv_draw_task_get_label_dsc

Try to get a label draw descriptor from a draw task.

 
lv_draw_label_dsc_t * lv_draw_task_get_label_dsc(lv_draw_task_t *task)
Parameters
NameTypeDescription
tasklv_draw_task_t *draw task

Returns: lv_draw_label_dsc_t * — the task's draw descriptor or NULL if the task is not of type LV_DRAW_TASK_TYPE_LABEL

Structs

struct

lv_draw_label_dsc_t

MemberTypeDescription
baselv_draw_dsc_base_t
textconst char *The text to draw
text_sizelv_point_tThe size of the text
fontconst lv_font_t *The font to use. Fallback fonts are also handled.
colorlv_color_tColor of the text
line_spaceint32_tExtra space between the lines
letter_spaceint32_tExtra space between the characters
ofs_xint32_tOffset the text with this value horizontally
ofs_yint32_tOffset the text with this value vertically
rotationint32_tRotation of the letters in 0.1 degree unit
sel_startuint32_tThe first characters index for selection (not byte index). LV_DRAW_LABEL_NO_TXT_SEL for no selection
sel_enduint32_tThe last characters's index for selection (not byte index). LV_DRAW_LABEL_NO_TXT_SEL for no selection
sel_colorlv_color_tColor of the selected characters
sel_bg_colorlv_color_tBackground color of the selected characters
text_lengthuint32_tThe number of characters to render. 0: means render until reaching the \0 termination.
alignlv_text_align_tThe alignment of the text LV_TEXT_ALIGN_LEFT/RIGHT/CENTER
bidi_dirlv_base_dir_tThe base direction. Used when type setting Right-to-left (e.g. Arabic) texts
opalv_opa_tOpacity of the text in 0...255 range. LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well
outline_stroke_opalv_opa_tLetter outline stroke opacity
decorlv_text_decor_tText decoration, e.g. underline
flaglv_text_flag_tSome flags to control type setting
text_localuint8_t1: malloc a buffer and copy text there. 0: text will be valid during rendering.
text_staticuint8_tIndicate that the text is constant and its pointer can be safely saved e.g. in a cache.
has_bideduint8_t1: already executed lv_bidi_process_paragraph. 0: has not been executed lv_bidi_process_paragraph.
hintlv_draw_label_hint_t *Pointer to an externally stored struct where some data can be cached to speed up rendering
outline_stroke_colorlv_color_t
outline_stroke_widthint32_t
Used by 12 functions
  • lv_obj_init_draw_label_dsc — param draw_dsc
  • lv_draw_eve_label — param dsc
  • lv_draw_label_dsc_init — param dsc
  • lv_draw_label — param dsc
  • lv_draw_character — param dsc
  • lv_draw_label_iterate_characters — param dsc
  • lv_draw_nanovg_label — param dsc
  • lv_draw_nema_gfx_label — param dsc
  • lv_draw_dave2d_label — param dsc
  • lv_draw_sdl_label — param dsc
  • lv_draw_sw_label — param dsc
  • lv_draw_vg_lite_label — param dsc
struct

lv_draw_letter_dsc_t

MemberTypeDescription
baselv_draw_dsc_base_t
unicodeuint32_t
fontconst lv_font_t *
colorlv_color_t
rotationint32_t
scale_xint32_t
scale_yint32_t
skew_xint32_t
skew_yint32_t
pivotlv_point_t
opalv_opa_t
decorlv_text_decor_t
blend_modelv_blend_mode_t
outline_stroke_opalv_opa_t
outline_stroke_widthint32_t
outline_stroke_colorlv_color_t
Used by 5 functions
  • lv_draw_letter_dsc_init — param dsc
  • lv_draw_letter — param dsc
  • lv_draw_nanovg_letter — param dsc
  • lv_draw_sw_letter — param dsc
  • lv_draw_vg_lite_letter — param dsc

Typedefs

lv_draw_glyph_cb_t

 
typedef void(* lv_draw_glyph_cb_t) (lv_draw_task_t *t, lv_draw_glyph_dsc_t *dsc, lv_draw_fill_dsc_t *fill_dsc, const lv_area_t *fill_area)

Passed as a parameter to lv_draw_label_iterate_characters to draw the characters one by one

Used by 2 functions
  • lv_draw_label_iterate_characters — param cb
  • lv_draw_unit_draw_letter — param cb

Macros

LV_DRAW_LABEL_NO_TXT_SEL

 
#define LV_DRAW_LABEL_NO_TXT_SEL (0xFFFF)

Dependencies

How is this guide?

Last updated on

On this page