lv_txt_get_next_word() function
Get the next word of text. A word is delimited by break characters. If the word cannot fit in the max_width space, obey LV_TXT_LINE_BREAK_LONG_* rules. If the next word cannot fit anything, return 0. If the first character is a break character, returns the next index. Example calls from lv_txt_get_next_line() assuming sufficient max_width and txt = "Test text\n" 0123456789 Calls would be as follows: 1. Return i=4, pointing at breakchar ' ', for the string "Test" 2. Return i=5, since i=4 was a breakchar. 3. Return i=9, pointing at breakchar '\n' 4. Parenting lv_txt_get_next_line() would detect subsequent '\0' TODO: Returned word_w_ptr may overestimate the returned word's width when max_width is reached. In current usage, this has no impact.
Arguments
txt
a '\0' terminated string
max_width
max width of the text (break the lines to fit this size). Set COORD_MAX to avoid line breaks
word_w_ptr
width (in pixels) of the parsed word. May be NULL.
cmd_state
pointer to a txt_cmd_state_t variable which stores the current state of command processing
force
Force return the fraction of the word that can fit in the provided space.
Return value
the index of the first char of the next word (in byte index not letter index. With UTF-8 they are different)