# lv_bidi.h (/api/misc/lv_bidi_h)



<RelatedHeaders name="lv_bidi_private.h" isPrivate="false" />

<ApiSummary functions="2" enums="1" macros="2" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (1)&#x22;,&#x22;Other (1)&#x22;]">
  <ApiTab value="Setters (1)">
    <ApiMember kind="function" name="lv_bidi_set_custom_neutrals_static" file="misc/lv_bidi.h" line="57" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_bidi.h#L57">
      lv_bidi_set_custom_neutrals_static [#lv_bidi_set_custom_neutrals_static]

      Set custom neutrals string

      ```c title=" " lineNumbers=1
      void lv_bidi_set_custom_neutrals_static(const char *neutrals)
      ```

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

      | Name       | Type           | Description                                        |
      | ---------- | -------------- | -------------------------------------------------- |
      | `neutrals` | `const char *` | default " \t\n\r.,:;'"\`!?%/\\-=()\[]\{}\<>@#&$\|" |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (1)">
    <ApiMember kind="function" name="lv_bidi_calculate_align" file="misc/lv_bidi.h" line="51" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_bidi.h#L51">
      lv_bidi_calculate_align [#lv_bidi_calculate_align]

      Get the real text alignment from the a text alignment, base direction and a text.

      ```c title=" " lineNumbers=1
      void lv_bidi_calculate_align(lv_text_align_t *align, lv_base_dir_t *base_dir, const char *txt)
      ```

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

      | Name       | Type                                                           | Description                                                                                     |
      | ---------- | -------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
      | `align`    | <ApiLink name="lv_text_align_t" display="lv_text_align_t *" /> | LV\_TEXT\_ALIGN\_..., write back the calculated align here (LV\_TEXT\_ALIGN\_LEFT/RIGHT/CENTER) |
      | `base_dir` | <ApiLink name="lv_base_dir_t" display="lv_base_dir_t *" />     | LV\_BASE\_DIR\_..., write the calculated base dir here (LV\_BASE\_DIR\_LTR/RTL)                 |
      | `txt`      | `const char *`                                                 | a text, used with LV\_BASE\_DIR\_AUTO to determine the base direction                           |
    </ApiMember>
  </ApiTab>
</ApiTabs>

Enums [#enums]

<ApiMember kind="enum" name="lv_base_dir_t" file="misc/lv_bidi.h" line="31" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_bidi.h#L31">
  lv_base_dir_t [#lv_base_dir_t]

  | Name                  | Value  |
  | --------------------- | ------ |
  | `LV_BASE_DIR_LTR`     | `0x00` |
  | `LV_BASE_DIR_RTL`     | `0x01` |
  | `LV_BASE_DIR_AUTO`    | `0x02` |
  | `LV_BASE_DIR_NEUTRAL` | `0x20` |
  | `LV_BASE_DIR_WEAK`    | `0x21` |
</ApiMember>

<TypeUsedBy name="lv_base_dir_t" count="7">
  * `lv_obj_set_style_base_dir` — param `value`
  * `lv_bidi_calculate_align` — param `base_dir`
  * `lv_bidi_process` — param `base_dir`
  * `lv_bidi_get_logical_pos` — param `base_dir`
  * `lv_bidi_get_visual_pos` — param `base_dir`
  * `lv_bidi_process_paragraph` — param `base_dir`
  * `lv_style_set_base_dir` — param `value`
</TypeUsedBy>

Macros [#macros]

<ApiMember kind="macro" name="LV_BIDI_LRO" file="misc/lv_bidi.h" line="25" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_bidi.h#L25">
  LV_BIDI_LRO [#lv_bidi_lro]

  ```c title=" " lineNumbers=1
  #define LV_BIDI_LRO "\xE2\x80\xAD" /*U+202D*/
  ```

  Special non printable strong characters. They can be inserted to texts to affect the run's direction
</ApiMember>

<ApiMember kind="macro" name="LV_BIDI_RLO" file="misc/lv_bidi.h" line="26" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/misc/lv_bidi.h#L26">
  LV_BIDI_RLO [#lv_bidi_rlo]

  ```c title=" " lineNumbers=1
  #define LV_BIDI_RLO "\xE2\x80\xAE" /*U+202E*/
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_types.h&#x22;, &#x22;lv_text.h&#x22;]" includedBy="[&#x22;lv_obj_style.h&#x22;, &#x22;lv_draw_label.h&#x22;, &#x22;lv_bidi_private.h&#x22;, &#x22;lv_style.h&#x22;]" transitiveIncludes="[&#x22;lv_area.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_draw_buf.h&#x22;, &#x22;lv_font.h&#x22;, &#x22;lv_image_dsc.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_sprintf.h&#x22;, &#x22;lv_string.h&#x22;, &#x22;lv_symbol_def.h&#x22;]" />
