# lv_text_private.h (/api/private/misc/lv_text_private_h)



<RelatedHeaders name="lv_text.h" isPrivate="true" />

<ApiSummary functions="17" enums="1" structs="1" macros="3" variables="8" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (1)&#x22;,&#x22;Getters (7)&#x22;,&#x22;Other (9)&#x22;]">
  <ApiTab value="Setters (1)">
    <ApiMember kind="function" name="lv_text_set_text_vfmt" file="private/misc/lv_text_private.h" line="139" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L139">
      lv_text_set_text_vfmt [#lv_text_set_text_vfmt]

      Return a new formatted text. Memory will be allocated to store the text.

      ```c title=" " lineNumbers=1
      char * lv_text_set_text_vfmt(const char *fmt, va_list ap)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type           | Description          |
      | ----- | -------------- | -------------------- |
      | `fmt` | `const char *` | `printf`-like format |
      | `ap`  | `va_list`      | items to print       |

      **Returns:** `char *` — pointer to the allocated text string.
    </ApiMember>
  </ApiTab>

  <ApiTab value="Getters (7)">
    <ApiMember kind="function" name="lv_text_get_size_attributes" file="private/misc/lv_text_private.h" line="68" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L68">
      lv_text_get_size_attributes [#lv_text_get_size_attributes]

      Get size of a text

      ```c title=" " lineNumbers=1
      void lv_text_get_size_attributes(lv_point_t *size_res, const char *text, const lv_font_t *font, lv_text_attributes_t *attributes)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name         | Type                                                                     | Description                                                      |
      | ------------ | ------------------------------------------------------------------------ | ---------------------------------------------------------------- |
      | `size_res`   | <ApiLink name="lv_point_t" display="lv_point_t *" />                     | pointer to a 'point\_t' variable to store the result             |
      | `text`       | `const char *`                                                           | pointer to a text                                                |
      | `font`       | <ApiLink name="lv_font_t" display="const lv_font_t *" />                 | pointer to font of the text                                      |
      | `attributes` | <ApiLink name="lv_text_attributes_t" display="lv_text_attributes_t *" /> | the text attributes, flags for line break behaviour, spacing etc |
    </ApiMember>

    <ApiMember kind="function" name="lv_text_get_width" file="private/misc/lv_text_private.h" line="79" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L79">
      lv_text_get_width [#lv_text_get_width]

      Give the length of a text with a given font with text flags

      ```c title=" " lineNumbers=1
      int32_t lv_text_get_width(const char *txt, uint32_t length, const lv_font_t *font, const lv_text_attributes_t *attributes)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name         | Type                                                                           | Description                                                                              |
      | ------------ | ------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- |
      | `txt`        | `const char *`                                                                 | a '\0' terminate string                                                                  |
      | `length`     | `uint32_t`                                                                     | length of 'txt' in byte count and not characters (Á is 1 character but 2 bytes in UTF-8) |
      | `font`       | <ApiLink name="lv_font_t" display="const lv_font_t *" />                       | pointer to font of the text                                                              |
      | `attributes` | <ApiLink name="lv_text_attributes_t" display="const lv_text_attributes_t *" /> | the text attributes, flags for line break behaviour, spacing etc                         |

      **Returns:** `int32_t` — length of a char\_num long text
    </ApiMember>

    <ApiMember kind="function" name="lv_text_get_line_width" file="private/misc/lv_text_private.h" line="90" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L90">
      lv_text_get_line_width [#lv_text_get_line_width]

      Same as <ApiLink name="lv_text_get_width" display="lv_text_get_width()" /> but without the trailing white space of the line.

      ```c title=" " lineNumbers=1
      int32_t lv_text_get_line_width(const char *txt, uint32_t length, const lv_font_t *font, const lv_text_attributes_t *attributes)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name         | Type                                                                           | Description                                                      |
      | ------------ | ------------------------------------------------------------------------------ | ---------------------------------------------------------------- |
      | `txt`        | `const char *`                                                                 | a '\0' terminate string                                          |
      | `length`     | `uint32_t`                                                                     | length of 'txt' in byte count and not characters                 |
      | `font`       | <ApiLink name="lv_font_t" display="const lv_font_t *" />                       | pointer to font of the text                                      |
      | `attributes` | <ApiLink name="lv_text_attributes_t" display="const lv_text_attributes_t *" /> | the text attributes, flags for line break behaviour, spacing etc |

      **Returns:** `int32_t` — visible width of the line
    </ApiMember>

    <ApiMember kind="function" name="lv_text_get_next_line" file="private/misc/lv_text_private.h" line="112" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L112">
      lv_text_get_next_line [#lv_text_get_next_line]

      Get the next line of text. Check line length and break chars too.

      ```c title=" " lineNumbers=1
      uint32_t lv_text_get_next_line(const char *txt, uint32_t len, const lv_font_t *font, int32_t *used_width, lv_text_attributes_t *attributes)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name         | Type                                                                     | Description                                                                                               |
      | ------------ | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- |
      | `txt`        | `const char *`                                                           | a '\0' terminated string                                                                                  |
      | `len`        | `uint32_t`                                                               | length of 'txt' in bytes                                                                                  |
      | `font`       | <ApiLink name="lv_font_t" display="const lv_font_t *" />                 | pointer to a font                                                                                         |
      | `used_width` | `int32_t *`                                                              | When used\_width != NULL, save the width of this line if flag == LV\_TEXT\_FLAG\_NONE, otherwise save -1. |
      | `attributes` | <ApiLink name="lv_text_attributes_t" display="lv_text_attributes_t *" /> | text attributes, flags to control line break behaviour, spacing etc                                       |

      **Returns:** `uint32_t` — the index of the first char of the new line (in byte index not letter index. With UTF-8 they are different)
    </ApiMember>

    <ApiMember kind="function" name="lv_text_get_size_internal" file="private/misc/lv_text_private.h" line="155" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L155">
      lv_text_get_size_internal [#lv_text_get_size_internal]

      Internal implementation of <ApiLink name="lv_text_get_size" />

      ```c title=" " lineNumbers=1
      void lv_text_get_size_internal(lv_point_t *size_res, const char *text, const lv_font_t *font, int32_t letter_space, int32_t line_space, int32_t max_width, lv_text_flag_t flag)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name           | Type                                                     |
      | -------------- | -------------------------------------------------------- |
      | `size_res`     | <ApiLink name="lv_point_t" display="lv_point_t *" />     |
      | `text`         | `const char *`                                           |
      | `font`         | <ApiLink name="lv_font_t" display="const lv_font_t *" /> |
      | `letter_space` | `int32_t`                                                |
      | `line_space`   | `int32_t`                                                |
      | `max_width`    | `int32_t`                                                |
      | `flag`         | <ApiLink name="lv_text_flag_t" />                        |
    </ApiMember>

    <ApiMember kind="function" name="lv_font_get_bottom_trim_internal" file="private/misc/lv_text_private.h" line="277" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L277">
      lv_font_get_bottom_trim_internal [#lv_font_get_bottom_trim_internal]

      ```c title=" " lineNumbers=1
      static int32_t lv_font_get_bottom_trim_internal(const lv_font_t *font, lv_text_leading_trim_t trim)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                                     |
      | ------ | -------------------------------------------------------- |
      | `font` | <ApiLink name="lv_font_t" display="const lv_font_t *" /> |
      | `trim` | <ApiLink name="lv_text_leading_trim_t" />                |
    </ApiMember>

    <ApiMember kind="function" name="lv_font_get_top_trim_internal" file="private/misc/lv_text_private.h" line="292" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L292">
      lv_font_get_top_trim_internal [#lv_font_get_top_trim_internal]

      ```c title=" " lineNumbers=1
      static int32_t lv_font_get_top_trim_internal(const lv_font_t *font, lv_text_leading_trim_t trim)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                                     |
      | ------ | -------------------------------------------------------- |
      | `font` | <ApiLink name="lv_font_t" display="const lv_font_t *" /> |
      | `trim` | <ApiLink name="lv_text_leading_trim_t" />                |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (9)">
    <ApiMember kind="function" name="lv_text_attributes_init" file="private/misc/lv_text_private.h" line="59" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L59">
      lv_text_attributes_init [#lv_text_attributes_init]

      Initialize the text attributes descriptor

      ```c title=" " lineNumbers=1
      void lv_text_attributes_init(lv_text_attributes_t *attributes)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name         | Type                                                                     | Description                                  |
      | ------------ | ------------------------------------------------------------------------ | -------------------------------------------- |
      | `attributes` | <ApiLink name="lv_text_attributes_t" display="lv_text_attributes_t *" /> | the text attributes descriptor to initialize |
    </ApiMember>

    <ApiMember kind="function" name="lv_text_is_cmd" file="private/misc/lv_text_private.h" line="99" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L99">
      lv_text_is_cmd [#lv_text_is_cmd]

      Check if c is command state

      ```c title=" " lineNumbers=1
      bool lv_text_is_cmd(lv_text_cmd_state_t *state, uint32_t c)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                                                   |
      | ------- | ---------------------------------------------------------------------- |
      | `state` | <ApiLink name="lv_text_cmd_state_t" display="lv_text_cmd_state_t *" /> |
      | `c`     | `uint32_t`                                                             |

      **Returns:** `bool` — True if c is state
    </ApiMember>

    <ApiMember kind="function" name="lv_text_ins" file="private/misc/lv_text_private.h" line="121" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L121">
      lv_text_ins [#lv_text_ins]

      Insert a string into another

      ```c title=" " lineNumbers=1
      void lv_text_ins(char *txt_buf, uint32_t pos, const char *ins_txt)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name      | Type           | Description                                                                    |
      | --------- | -------------- | ------------------------------------------------------------------------------ |
      | `txt_buf` | `char *`       | the original text (must be big enough for the result text and NULL terminated) |
      | `pos`     | `uint32_t`     | position to insert (0: before the original text, 1: after the first char etc.) |
      | `ins_txt` | `const char *` | text to insert, must be '\0' terminated                                        |
    </ApiMember>

    <ApiMember kind="function" name="lv_text_cut" file="private/misc/lv_text_private.h" line="130" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L130">
      lv_text_cut [#lv_text_cut]

      Delete a part of a string

      ```c title=" " lineNumbers=1
      void lv_text_cut(char *txt, uint32_t pos, uint32_t len)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type       | Description                                                                                                |
      | ----- | ---------- | ---------------------------------------------------------------------------------------------------------- |
      | `txt` | `char *`   | string to modify, must be '\0' terminated and should point to a heap or stack frame, not read-only memory. |
      | `pos` | `uint32_t` | position where to start the deleting (0: before the first char, 1: after the first char etc.)              |
      | `len` | `uint32_t` | number of characters to delete                                                                             |
    </ApiMember>

    <ApiMember kind="function" name="lv_text_encoded_letter_next_2" file="private/misc/lv_text_private.h" line="150" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L150">
      lv_text_encoded_letter_next_2 [#lv_text_encoded_letter_next_2]

      Decode two encoded character from a string.

      ```c title=" " lineNumbers=1
      void lv_text_encoded_letter_next_2(const char *txt, uint32_t *letter, uint32_t *letter_next, uint32_t *ofs)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name          | Type           | Description                                                                                                                       |
      | ------------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------- |
      | `txt`         | `const char *` | pointer to '\0' terminated string                                                                                                 |
      | `letter`      | `uint32_t *`   | the first decoded Unicode character or 0 on invalid data code                                                                     |
      | `letter_next` | `uint32_t *`   | the second decoded Unicode character or 0 on invalid data code                                                                    |
      | `ofs`         | `uint32_t *`   | start index in 'txt' where to start. After the call it will point to the next encoded char in 'txt'. NULL to use txt\[0] as index |
    </ApiMember>

    <ApiMember kind="function" name="lv_text_is_break_char" file="private/misc/lv_text_private.h" line="163" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L163">
      lv_text_is_break_char [#lv_text_is_break_char]

      Test if char is break char or not (a text can broken here or not)

      ```c title=" " lineNumbers=1
      static bool lv_text_is_break_char(uint32_t letter)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name     | Type       | Description |
      | -------- | ---------- | ----------- |
      | `letter` | `uint32_t` | a letter    |

      **Returns:** `bool` — false: 'letter' is not break char
    </ApiMember>

    <ApiMember kind="function" name="lv_text_is_hanging_space" file="private/misc/lv_text_private.h" line="184" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L184">
      lv_text_is_hanging_space [#lv_text_is_hanging_space]

      Test if char is white space which may hang out of the end of a line

      ```c title=" " lineNumbers=1
      static bool lv_text_is_hanging_space(uint32_t letter)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name     | Type       | Description |
      | -------- | ---------- | ----------- |
      | `letter` | `uint32_t` | a letter    |

      **Returns:** `bool` — false: 'letter' is not hangable white space
    </ApiMember>

    <ApiMember kind="function" name="lv_text_is_a_word" file="private/misc/lv_text_private.h" line="194" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L194">
      lv_text_is_a_word [#lv_text_is_a_word]

      Test if char is break char or not (a text can broken here or not)

      ```c title=" " lineNumbers=1
      static bool lv_text_is_a_word(uint32_t letter)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name     | Type       | Description |
      | -------- | ---------- | ----------- |
      | `letter` | `uint32_t` | a letter    |

      **Returns:** `bool` — false: 'letter' is not break char
    </ApiMember>

    <ApiMember kind="function" name="lv_text_is_marker" file="private/misc/lv_text_private.h" line="249" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L249">
      lv_text_is_marker [#lv_text_is_marker]

      Test if character can be treated as marker, and don't need to be rendered. Note, this is not a full list. Add your findings to the list.

      ```c title=" " lineNumbers=1
      static bool lv_text_is_marker(uint32_t letter)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name     | Type       | Description |
      | -------- | ---------- | ----------- |
      | `letter` | `uint32_t` | a letter    |

      **Returns:** `bool` — true if so
    </ApiMember>
  </ApiTab>
</ApiTabs>

Enums [#enums]

<ApiMember kind="enum" name="lv_text_cmd_state_t" file="private/misc/lv_text_private.h" line="37" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L37">
  lv_text_cmd_state_t [#lv_text_cmd_state_t]

  State machine for text renderer.

  | Name                     | Description              |
  | ------------------------ | ------------------------ |
  | `LV_TEXT_CMD_STATE_WAIT` | Waiting for command      |
  | `LV_TEXT_CMD_STATE_PAR`  | Processing the parameter |
  | `LV_TEXT_CMD_STATE_IN`   | Processing the command   |
</ApiMember>

<TypeUsedBy name="lv_text_cmd_state_t" count="1">
  * `lv_text_is_cmd` — param `state`
</TypeUsedBy>

Structs [#structs]

<ApiMember kind="struct" name="lv_text_attributes_t">
  lv_text_attributes_t [#lv_text_attributes_t]

  | Member         | Type                              | Description                                                                       |
  | -------------- | --------------------------------- | --------------------------------------------------------------------------------- |
  | `letter_space` | `int32_t`                         | Letter space between letters                                                      |
  | `line_space`   | `int32_t`                         | Space between lines of text                                                       |
  | `max_width`    | `int32_t`                         | Max width of the text (break the lines to fit this size). Set COORD\_MAX to avoid |
  | `text_flags`   | <ApiLink name="lv_text_flag_t" /> |                                                                                   |
</ApiMember>

<TypeUsedBy name="lv_text_attributes_t" count="5">
  * `lv_text_attributes_init` — param `attributes`
  * `lv_text_get_size_attributes` — param `attributes`
  * `lv_text_get_width` — param `attributes`
  * `lv_text_get_line_width` — param `attributes`
  * `lv_text_get_next_line` — param `attributes`
</TypeUsedBy>

Macros [#macros]

<ApiMember kind="macro" name="LV_TXT_ENC_UTF8" file="private/misc/lv_text_private.h" line="27" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L27">
  LV_TXT_ENC_UTF8 [#lv_txt_enc_utf8]

  ```c title=" " lineNumbers=1
  #define LV_TXT_ENC_UTF8 1
  ```
</ApiMember>

<ApiMember kind="macro" name="LV_TXT_ENC_ASCII" file="private/misc/lv_text_private.h" line="28" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L28">
  LV_TXT_ENC_ASCII [#lv_txt_enc_ascii]

  ```c title=" " lineNumbers=1
  #define LV_TXT_ENC_ASCII 2
  ```
</ApiMember>

<ApiMember kind="macro" name="LV_TEXT_LEN_MAX" file="private/misc/lv_text_private.h" line="30" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L30">
  LV_TEXT_LEN_MAX [#lv_text_len_max]

  ```c title=" " lineNumbers=1
  #define LV_TEXT_LEN_MAX UINT32_MAX
  ```
</ApiMember>

Variables [#variables]

<ApiMember kind="variable" name="lv_text_encoded_size" file="private/misc/lv_text_private.h" line="317" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L317">
  lv_text_encoded_size [#lv_text_encoded_size]

  ```c title=" " lineNumbers=1
  uint8_t(*const lv_text_encoded_size
  ```

  Give the size of an encoded character
</ApiMember>

<ApiMember kind="variable" name="lv_text_unicode_to_encoded" file="private/misc/lv_text_private.h" line="324" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L324">
  lv_text_unicode_to_encoded [#lv_text_unicode_to_encoded]

  ```c title=" " lineNumbers=1
  uint32_t(*const lv_text_unicode_to_encoded
  ```

  Convert a Unicode letter to encoded
</ApiMember>

<ApiMember kind="variable" name="lv_text_encoded_conv_wc" file="private/misc/lv_text_private.h" line="331" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L331">
  lv_text_encoded_conv_wc [#lv_text_encoded_conv_wc]

  ```c title=" " lineNumbers=1
  uint32_t(*const lv_text_encoded_conv_wc
  ```

  Convert a wide character, e.g. 'Á' little endian to be compatible with the encoded format.
</ApiMember>

<ApiMember kind="variable" name="lv_text_encoded_next" file="private/misc/lv_text_private.h" line="341" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L341">
  lv_text_encoded_next [#lv_text_encoded_next]

  ```c title=" " lineNumbers=1
  uint32_t(*const lv_text_encoded_next
  ```

  Decode the next encoded character from a string.
</ApiMember>

<ApiMember kind="variable" name="lv_text_encoded_prev" file="private/misc/lv_text_private.h" line="352" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L352">
  lv_text_encoded_prev [#lv_text_encoded_prev]

  ```c title=" " lineNumbers=1
  uint32_t(*const lv_text_encoded_prev
  ```

  Get the previous encoded character form a string.
</ApiMember>

<ApiMember kind="variable" name="lv_text_encoded_get_byte_id" file="private/misc/lv_text_private.h" line="361" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L361">
  lv_text_encoded_get_byte_id [#lv_text_encoded_get_byte_id]

  ```c title=" " lineNumbers=1
  uint32_t(*const lv_text_encoded_get_byte_id
  ```

  Convert a letter index (in the encoded text) to byte index. E.g. in UTF-8 "AÁRT" index of 'R' is 2 but start at byte 3 because 'Á' is 2 bytes long
</ApiMember>

<ApiMember kind="variable" name="lv_text_encoded_get_char_id" file="private/misc/lv_text_private.h" line="370" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L370">
  lv_text_encoded_get_char_id [#lv_text_encoded_get_char_id]

  ```c title=" " lineNumbers=1
  uint32_t(*const lv_text_encoded_get_char_id
  ```

  Convert a byte index (in an encoded text) to character index. E.g. in UTF-8 "AÁRT" index of 'R' is 2 but start at byte 3 because 'Á' is 2 bytes long
</ApiMember>

<ApiMember kind="variable" name="lv_text_get_encoded_length" file="private/misc/lv_text_private.h" line="378" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/lv_text_private.h#L378">
  lv_text_get_encoded_length [#lv_text_get_encoded_length]

  ```c title=" " lineNumbers=1
  uint32_t(*const lv_text_get_encoded_length
  ```

  Get the number of characters (and NOT bytes) in a string. E.g. in UTF-8 "ÁBC" is 3 characters (but 4 bytes)
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lvgl_public.h&#x22;]" includedBy="[&#x22;lvgl_private.h&#x22;]" />
