# lv_span.h (/api/widgets/span/lv_span_h)



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

<ApiSummary functions="33" enums="3" structs="1" typedefs="1" variables="1" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (12)&#x22;,&#x22;Getters (14)&#x22;,&#x22;Other (7)&#x22;]">
  <ApiTab value="Setters (12)">
    <ApiMember kind="function" name="lv_span_set_text" file="widgets/span/lv_span.h" line="108" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L108">
      lv_span_set_text [#lv_span_set_text]

      Set a new text for a span. Memory will be allocated to store the text by the span. As the spangroup is not passed a redraw (invalidation) can't be triggered automatically. Therefore `lv_spangroup_refresh(spangroup)` needs to be called manually,

      ```c title=" " lineNumbers=1
      void lv_span_set_text(lv_span_t *span, const char *text)
      ```

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

      | Name   | Type                                               | Description        |
      | ------ | -------------------------------------------------- | ------------------ |
      | `span` | <ApiLink name="lv_span_t" display="lv_span_t *" /> | pointer to a span. |
      | `text` | `const char *`                                     | pointer to a text. |
    </ApiMember>

    <ApiMember kind="function" name="lv_span_set_text_fmt" file="widgets/span/lv_span.h" line="119" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L119">
      lv_span_set_text_fmt [#lv_span_set_text_fmt]

      Set a new text for a span using a printf-like formatting string. Memory will be allocated to store the text by the span. As the spangroup is not passed a redraw (invalidation) can't be triggered automatically. Therefore `lv_spangroup_refresh(spangroup)` needs to be called manually,

      ```c title=" " lineNumbers=1
      void lv_span_set_text_fmt(lv_span_t *span, const char *fmt,...)
      ```

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

      | Name   | Type                                               | Description                 |
      | ------ | -------------------------------------------------- | --------------------------- |
      | `span` | <ApiLink name="lv_span_t" display="lv_span_t *" /> | pointer to a span.          |
      | `fmt`  | `const char *`                                     | `printf`-like format string |
      | `...`  |                                                    |                             |
    </ApiMember>

    <ApiMember kind="function" name="lv_span_set_text_static" file="widgets/span/lv_span.h" line="130" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L130">
      lv_span_set_text_static [#lv_span_set_text_static]

      Set a static text. It will not be saved by the span so the 'text' variable has to be 'alive' while the span exist. As the spangroup is not passed a redraw (invalidation) can't be triggered automatically. Therefore `lv_spangroup_refresh(spangroup)` needs to be called manually,

      Set a static text. It will not be saved by the span so the 'text' variable has to be 'alive' while the span exist.

      ```c title=" " lineNumbers=1
      void lv_span_set_text_static(lv_span_t *span, const char *text)
      ```

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

      | Name   | Type                                               | Description        |
      | ------ | -------------------------------------------------- | ------------------ |
      | `span` | <ApiLink name="lv_span_t" display="lv_span_t *" /> | pointer to a span. |
      | `text` | `const char *`                                     | pointer to a text. |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_set_span_text" file="widgets/span/lv_span.h" line="138" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L138">
      lv_spangroup_set_span_text [#lv_spangroup_set_span_text]

      Set a new text for a span. Memory will be allocated to store the text by the span.

      ```c title=" " lineNumbers=1
      void lv_spangroup_set_span_text(lv_obj_t *obj, lv_span_t *span, const char *text)
      ```

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

      | Name   | Type                                               | Description                    |
      | ------ | -------------------------------------------------- | ------------------------------ |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" />   | pointer to a spangroup widget. |
      | `span` | <ApiLink name="lv_span_t" display="lv_span_t *" /> | pointer to a span.             |
      | `text` | `const char *`                                     | pointer to a text.             |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_set_span_text_static" file="widgets/span/lv_span.h" line="146" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L146">
      lv_spangroup_set_span_text_static [#lv_spangroup_set_span_text_static]

      Set a new text for a span. Memory will be allocated to store the text by the span.

      ```c title=" " lineNumbers=1
      void lv_spangroup_set_span_text_static(lv_obj_t *obj, lv_span_t *span, const char *text)
      ```

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

      | Name   | Type                                               | Description                    |
      | ------ | -------------------------------------------------- | ------------------------------ |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" />   | pointer to a spangroup widget. |
      | `span` | <ApiLink name="lv_span_t" display="lv_span_t *" /> | pointer to a span.             |
      | `text` | `const char *`                                     | pointer to a text.             |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_set_span_text_fmt" file="widgets/span/lv_span.h" line="155" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L155">
      lv_spangroup_set_span_text_fmt [#lv_spangroup_set_span_text_fmt]

      Set a new text for a span using a printf-like formatting string. Memory will be allocated to store the text by the span.

      ```c title=" " lineNumbers=1
      void lv_spangroup_set_span_text_fmt(lv_obj_t *obj, lv_span_t *span, const char *fmt,...)
      ```

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

      | Name   | Type                                               | Description                    |
      | ------ | -------------------------------------------------- | ------------------------------ |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" />   | pointer to a spangroup widget. |
      | `span` | <ApiLink name="lv_span_t" display="lv_span_t *" /> | pointer to a span.             |
      | `fmt`  | `const char *`                                     | `printf`-like format string    |
      | `...`  |                                                    |                                |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_set_span_style" file="widgets/span/lv_span.h" line="171" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L171">
      lv_spangroup_set_span_style [#lv_spangroup_set_span_style]

      Copy all style properties of style to the bbuilt-in static style of the span.

      ```c title=" " lineNumbers=1
      void lv_spangroup_set_span_style(lv_obj_t *obj, lv_span_t *span, const lv_style_t *style)
      ```

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

      | Name    | Type                                                       | Description                                               |
      | ------- | ---------------------------------------------------------- | --------------------------------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" />           | pointer\_to a spangroup                                   |
      | `span`  | <ApiLink name="lv_span_t" display="lv_span_t *" />         | pointer to a span.                                        |
      | `style` | <ApiLink name="lv_style_t" display="const lv_style_t *" /> | pointer to a style to copy into the span's built-in style |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_set_align" file="widgets/span/lv_span.h" line="179" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L179">
      lv_spangroup_set_align [#lv_spangroup_set_align]

      DEPRECATED. Use the text\_align style property instead Set the align of the spangroup.

      ```c title=" " lineNumbers=1
      void lv_spangroup_set_align(lv_obj_t *obj, lv_text_align_t align)
      ```

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

      | Name    | Type                                             | Description                         |
      | ------- | ------------------------------------------------ | ----------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object.      |
      | `align` | <ApiLink name="lv_text_align_t" />               | see lv\_text\_align\_t for details. |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_set_overflow" file="widgets/span/lv_span.h" line="186" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L186">
      lv_spangroup_set_overflow [#lv_spangroup_set_overflow]

      Set the overflow of the spangroup.

      ```c title=" " lineNumbers=1
      void lv_spangroup_set_overflow(lv_obj_t *obj, lv_span_overflow_t overflow)
      ```

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

      | Name       | Type                                             | Description                            |
      | ---------- | ------------------------------------------------ | -------------------------------------- |
      | `obj`      | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object.         |
      | `overflow` | <ApiLink name="lv_span_overflow_t" />            | see lv\_span\_overflow\_t for details. |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_set_indent" file="widgets/span/lv_span.h" line="193" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L193">
      lv_spangroup_set_indent [#lv_spangroup_set_indent]

      Set the indent of the spangroup.

      ```c title=" " lineNumbers=1
      void lv_spangroup_set_indent(lv_obj_t *obj, int32_t indent)
      ```

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

      | Name     | Type                                             | Description                    |
      | -------- | ------------------------------------------------ | ------------------------------ |
      | `obj`    | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object. |
      | `indent` | <ApiLink name="int32_t" />                       | the first line indentation     |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_set_mode" file="widgets/span/lv_span.h" line="201" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L201">
      lv_spangroup_set_mode [#lv_spangroup_set_mode]

      DEPRECATED, set the width to LV\_SIZE\_CONTENT or fixed value to control expanding/wrapping" Set the mode of the spangroup.

      ```c title=" " lineNumbers=1
      void lv_spangroup_set_mode(lv_obj_t *obj, lv_span_mode_t mode)
      ```

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

      | Name   | Type                                             | Description                        |
      | ------ | ------------------------------------------------ | ---------------------------------- |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object.     |
      | `mode` | <ApiLink name="lv_span_mode_t" />                | see lv\_span\_mode\_t for details. |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_set_max_lines" file="widgets/span/lv_span.h" line="208" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L208">
      lv_spangroup_set_max_lines [#lv_spangroup_set_max_lines]

      Set maximum lines of the spangroup.

      ```c title=" " lineNumbers=1
      void lv_spangroup_set_max_lines(lv_obj_t *obj, int32_t lines)
      ```

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

      | Name    | Type                                             | Description                                                                         |
      | ------- | ------------------------------------------------ | ----------------------------------------------------------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object.                                                      |
      | `lines` | <ApiLink name="int32_t" />                       | max lines that can be displayed in LV\_SPAN\_MODE\_BREAK mode. \< 0 means no limit. |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Getters (14)">
    <ApiMember kind="function" name="lv_span_get_style" file="widgets/span/lv_span.h" line="220" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L220">
      lv_span_get_style [#lv_span_get_style]

      Get a pointer to the style of a span's built-in style. Any lv\_style\_set\_... functions can be applied on the returned style.

      ```c title=" " lineNumbers=1
      lv_style_t * lv_span_get_style(lv_span_t *span)
      ```

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

      | Name   | Type                                               | Description         |
      | ------ | -------------------------------------------------- | ------------------- |
      | `span` | <ApiLink name="lv_span_t" display="lv_span_t *" /> | pointer to the span |

      **Returns:** <ApiLink name="lv_style_t" display="lv_style_t *" /> — pointer to the style. (valid as long as the span is valid)
    </ApiMember>

    <ApiMember kind="function" name="lv_span_get_text" file="widgets/span/lv_span.h" line="227" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L227">
      lv_span_get_text [#lv_span_get_text]

      Get a pointer to the text of a span

      ```c title=" " lineNumbers=1
      const char * lv_span_get_text(lv_span_t *span)
      ```

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

      | Name   | Type                                               | Description         |
      | ------ | -------------------------------------------------- | ------------------- |
      | `span` | <ApiLink name="lv_span_t" display="lv_span_t *" /> | pointer to the span |

      **Returns:** `const char *` — pointer to the text
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_child" file="widgets/span/lv_span.h" line="241" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L241">
      lv_spangroup_get_child [#lv_spangroup_get_child]

      Get a spangroup child by its index.

      ```c title=" " lineNumbers=1
      lv_span_t * lv_spangroup_get_child(const lv_obj_t *obj, int32_t id)
      ```

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

      | Name  | Type                                                   | Description                                                                                                                                             |
      | ----- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | The spangroup object                                                                                                                                    |
      | `id`  | <ApiLink name="int32_t" />                             | the index of the child. 0: the oldest (firstly created) child 1: the second oldest child count-1: the youngest -1: the youngest -2: the second youngest |

      **Returns:** <ApiLink name="lv_span_t" display="lv_span_t *" /> — The child span at index `id`, or NULL if the ID does not exist
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_span_count" file="widgets/span/lv_span.h" line="248" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L248">
      lv_spangroup_get_span_count [#lv_spangroup_get_span_count]

      Get number of spans

      ```c title=" " lineNumbers=1
      uint32_t lv_spangroup_get_span_count(const lv_obj_t *obj)
      ```

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

      | Name  | Type                                                   | Description                                     |
      | ----- | ------------------------------------------------------ | ----------------------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | the spangroup object to get the child count of. |

      **Returns:** <ApiLink name="uint32_t" /> — the span count of the spangroup.
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_align" file="widgets/span/lv_span.h" line="255" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L255">
      lv_spangroup_get_align [#lv_spangroup_get_align]

      Get the align of the spangroup.

      ```c title=" " lineNumbers=1
      lv_text_align_t lv_spangroup_get_align(lv_obj_t *obj)
      ```

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

      | Name  | Type                                             | Description                    |
      | ----- | ------------------------------------------------ | ------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object. |

      **Returns:** <ApiLink name="lv_text_align_t" /> — the align value.
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_overflow" file="widgets/span/lv_span.h" line="262" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L262">
      lv_spangroup_get_overflow [#lv_spangroup_get_overflow]

      Get the overflow of the spangroup.

      ```c title=" " lineNumbers=1
      lv_span_overflow_t lv_spangroup_get_overflow(lv_obj_t *obj)
      ```

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

      | Name  | Type                                             | Description                    |
      | ----- | ------------------------------------------------ | ------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object. |

      **Returns:** <ApiLink name="lv_span_overflow_t" /> — the overflow value.
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_indent" file="widgets/span/lv_span.h" line="269" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L269">
      lv_spangroup_get_indent [#lv_spangroup_get_indent]

      Get the indent of the spangroup.

      ```c title=" " lineNumbers=1
      int32_t lv_spangroup_get_indent(lv_obj_t *obj)
      ```

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

      | Name  | Type                                             | Description                    |
      | ----- | ------------------------------------------------ | ------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object. |

      **Returns:** <ApiLink name="int32_t" /> — the indent value.
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_mode" file="widgets/span/lv_span.h" line="275" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L275">
      lv_spangroup_get_mode [#lv_spangroup_get_mode]

      Get the mode of the spangroup.

      ```c title=" " lineNumbers=1
      lv_span_mode_t lv_spangroup_get_mode(lv_obj_t *obj)
      ```

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

      | Name  | Type                                             | Description                    |
      | ----- | ------------------------------------------------ | ------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object. |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_max_lines" file="widgets/span/lv_span.h" line="282" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L282">
      lv_spangroup_get_max_lines [#lv_spangroup_get_max_lines]

      Get maximum lines of the spangroup.

      ```c title=" " lineNumbers=1
      int32_t lv_spangroup_get_max_lines(lv_obj_t *obj)
      ```

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

      | Name  | Type                                             | Description                    |
      | ----- | ------------------------------------------------ | ------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object. |

      **Returns:** <ApiLink name="int32_t" /> — the max lines value.
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_max_line_height" file="widgets/span/lv_span.h" line="288" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L288">
      lv_spangroup_get_max_line_height [#lv_spangroup_get_max_line_height]

      Get max line height of all span in the spangroup.

      ```c title=" " lineNumbers=1
      int32_t lv_spangroup_get_max_line_height(lv_obj_t *obj)
      ```

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

      | Name  | Type                                             | Description                    |
      | ----- | ------------------------------------------------ | ------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object. |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_expand_width" file="widgets/span/lv_span.h" line="297" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L297">
      lv_spangroup_get_expand_width [#lv_spangroup_get_expand_width]

      Get the text content width when all span of spangroup on a line.

      ```c title=" " lineNumbers=1
      uint32_t lv_spangroup_get_expand_width(lv_obj_t *obj, uint32_t max_width)
      ```

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

      | Name        | Type                                             | Description                                                                                                                       |
      | ----------- | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
      | `obj`       | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object.                                                                                                    |
      | `max_width` | <ApiLink name="uint32_t" />                      | if text content width >= max\_width, return max\_width to reduce computation, if max\_width == 0, returns the text content width. |

      **Returns:** <ApiLink name="uint32_t" /> — text content width or max\_width.
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_expand_height" file="widgets/span/lv_span.h" line="305" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L305">
      lv_spangroup_get_expand_height [#lv_spangroup_get_expand_height]

      Get the text content height with width fixed.

      ```c title=" " lineNumbers=1
      int32_t lv_spangroup_get_expand_height(lv_obj_t *obj, int32_t width)
      ```

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

      | Name    | Type                                             | Description                    |
      | ------- | ------------------------------------------------ | ------------------------------ |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object. |
      | `width` | <ApiLink name="int32_t" />                       | the width of the span group.   |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_span_coords" file="widgets/span/lv_span.h" line="330" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L330">
      lv_spangroup_get_span_coords [#lv_spangroup_get_span_coords]

      Get the span's coords in the spangroup.

      ```c title=" " lineNumbers=1
      lv_span_coords_t lv_spangroup_get_span_coords(lv_obj_t *obj, const lv_span_t *span)
      ```

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

      | Name   | Type                                                     | Description                    |
      | ------ | -------------------------------------------------------- | ------------------------------ |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" />         | pointer to a spangroup object. |
      | `span` | <ApiLink name="lv_span_t" display="const lv_span_t *" /> | pointer to a span.             |

      **Returns:** <ApiLink name="lv_span_coords_t" /> — the span's coords in the spangroup.

      <Callout type="info">
        Before calling this function, please make sure that the layout of span group has been updated. Like calling <ApiLink name="lv_obj_update_layout" display="lv_obj_update_layout()" /> like function.

        ```
        +--------+
        |Heading +--->------------------+
        |  Pos   |   |     Heading      |
        +--------+---+------------------+
        |                               |
        |                               |
        |                               |
        |            Middle   +--------+|
        |                     |Trailing||
        |                   +-|  Pos   ||
        |                   | +--------+|
        +-------------------v-----------+
        |     Trailing      |
        +-------------------+

        ```
      </Callout>
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_span_by_point" file="widgets/span/lv_span.h" line="338" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L338">
      lv_spangroup_get_span_by_point [#lv_spangroup_get_span_by_point]

      Get the span object by point.

      ```c title=" " lineNumbers=1
      lv_span_t * lv_spangroup_get_span_by_point(lv_obj_t *obj, const lv_point_t *point)
      ```

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

      | Name    | Type                                                       | Description                                      |
      | ------- | ---------------------------------------------------------- | ------------------------------------------------ |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" />           | pointer to a spangroup object.                   |
      | `point` | <ApiLink name="lv_point_t" display="const lv_point_t *" /> | pointer to point containing absolute coordinates |

      **Returns:** <ApiLink name="lv_span_t" display="lv_span_t *" /> — pointer to the span under the point or `NULL` if not found.
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (7)">
    <ApiMember kind="function" name="lv_span_stack_init" file="widgets/span/lv_span.h" line="70" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L70">
      lv_span_stack_init [#lv_span_stack_init]

      ```c title=" " lineNumbers=1
      void lv_span_stack_init(void)
      ```
    </ApiMember>

    <ApiMember kind="function" name="lv_span_stack_deinit" file="widgets/span/lv_span.h" line="71" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L71">
      lv_span_stack_deinit [#lv_span_stack_deinit]

      ```c title=" " lineNumbers=1
      void lv_span_stack_deinit(void)
      ```
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_create" file="widgets/span/lv_span.h" line="78" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L78">
      lv_spangroup_create [#lv_spangroup_create]

      Create a spangroup object

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_spangroup_create(lv_obj_t *parent)
      ```

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

      | Name     | Type                                             | Description                                                      |
      | -------- | ------------------------------------------------ | ---------------------------------------------------------------- |
      | `parent` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an object, it will be the parent of the new spangroup |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — pointer to the created spangroup
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_add_span" file="widgets/span/lv_span.h" line="85" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L85">
      lv_spangroup_add_span [#lv_spangroup_add_span]

      Create a span string descriptor and add to spangroup.

      ```c title=" " lineNumbers=1
      lv_span_t * lv_spangroup_add_span(lv_obj_t *obj)
      ```

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

      | Name  | Type                                             | Description                    |
      | ----- | ------------------------------------------------ | ------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object. |

      **Returns:** <ApiLink name="lv_span_t" display="lv_span_t *" /> — pointer to the created span.
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_delete_span" file="widgets/span/lv_span.h" line="95" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L95">
      lv_spangroup_delete_span [#lv_spangroup_delete_span]

      Remove the span from the spangroup and free memory.

      ```c title=" " lineNumbers=1
      void lv_spangroup_delete_span(lv_obj_t *obj, lv_span_t *span)
      ```

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

      | Name   | Type                                               | Description                    |
      | ------ | -------------------------------------------------- | ------------------------------ |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" />   | pointer to a spangroup object. |
      | `span` | <ApiLink name="lv_span_t" display="lv_span_t *" /> | pointer to a span.             |

      <Callout type="info">
        Note that before calling `lv_spangroup_delete_span` `lv_observer_remove` needs to be called manually as LVGL can't remove the binding automatically.
      </Callout>
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_refresh" file="widgets/span/lv_span.h" line="348" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L348">
      lv_spangroup_refresh [#lv_spangroup_refresh]

      Update the mode of the spangroup.

      ```c title=" " lineNumbers=1
      void lv_spangroup_refresh(lv_obj_t *obj)
      ```

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

      | Name  | Type                                             | Description                    |
      | ----- | ------------------------------------------------ | ------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object. |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_bind_span_text" file="widgets/span/lv_span.h" line="363" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L363">
      lv_spangroup_bind_span_text [#lv_spangroup_bind_span_text]

      Bind an integer, string, or pointer Subject to a Spangroup's Span.

      ```c title=" " lineNumbers=1
      lv_observer_t * lv_spangroup_bind_span_text(lv_obj_t *obj, lv_span_t *span, lv_subject_t *subject, const char *fmt)
      ```

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

      | Name      | Type                                                     | Description                                                                                                      |
      | --------- | -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
      | `obj`     | <ApiLink name="lv_obj_t" display="lv_obj_t *" />         | pointer to Spangroup                                                                                             |
      | `span`    | <ApiLink name="lv_span_t" display="lv_span_t *" />       | pointer to Span                                                                                                  |
      | `subject` | <ApiLink name="lv_subject_t" display="lv_subject_t *" /> | pointer to Subject                                                                                               |
      | `fmt`     | `const char *`                                           | optional printf-like format string with 1 format specifier (e.g. "%d °C") or NULL to bind to the value directly. |

      **Returns:** <ApiLink name="lv_observer_t" display="lv_observer_t *" /> — pointer to newly-created Observer

      <Callout type="info">
        If `fmt == NULL` strings and pointers (`\0` terminated string) will be shown as text as they are, integers as d, floats as %0.1f
      </Callout>
    </ApiMember>
  </ApiTab>
</ApiTabs>

Enums [#enums]

<ApiMember kind="enum" name="lv_span_overflow_t" file="widgets/span/lv_span.h" line="33" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L33">
  lv_span_overflow_t [#lv_span_overflow_t]

  | Name                        | Description  |
  | --------------------------- | ------------ |
  | `LV_SPAN_OVERFLOW_CLIP`     |              |
  | `LV_SPAN_OVERFLOW_ELLIPSIS` |              |
  | `LV_SPAN_OVERFLOW_LAST`     | Fence member |
</ApiMember>

<TypeUsedBy name="lv_span_overflow_t" count="1">
  * `lv_spangroup_set_overflow` — param `overflow`
</TypeUsedBy>

<ApiMember kind="enum" name="lv_span_mode_t" file="widgets/span/lv_span.h" line="39" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L39">
  lv_span_mode_t [#lv_span_mode_t]

  | Name                  | Description                                            |
  | --------------------- | ------------------------------------------------------ |
  | `LV_SPAN_MODE_FIXED`  | fixed the obj size                                     |
  | `LV_SPAN_MODE_EXPAND` | Expand the object size to the text size                |
  | `LV_SPAN_MODE_BREAK`  | Keep width, break the too long lines and expand height |
  | `LV_SPAN_MODE_LAST`   | Fence member                                           |
</ApiMember>

<TypeUsedBy name="lv_span_mode_t" count="1">
  * `lv_spangroup_set_mode` — param `mode`
</TypeUsedBy>

<ApiMember kind="enum" name="_lv_property_span_id_t" file="widgets/span/lv_span.h" line="56" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L56">
  \_lv_property_span_id_t [#_lv_property_span_id_t]

  | Name                         | Value                                                         |
  | ---------------------------- | ------------------------------------------------------------- |
  | `LV_PROPERTY_SPAN_ALIGN`     | `(LV_PROPERTY_SPAN_START + ((int) 0 )) \| ((  1   ) <<  28 )` |
  | `LV_PROPERTY_SPAN_OVERFLOW`  | `(LV_PROPERTY_SPAN_START + ((int) 1 )) \| ((  1   ) <<  28 )` |
  | `LV_PROPERTY_SPAN_INDENT`    | `(LV_PROPERTY_SPAN_START + ((int) 2 )) \| ((  1   ) <<  28 )` |
  | `LV_PROPERTY_SPAN_MODE`      | `(LV_PROPERTY_SPAN_START + ((int) 3 )) \| ((  1   ) <<  28 )` |
  | `LV_PROPERTY_SPAN_MAX_LINES` | `(LV_PROPERTY_SPAN_START + ((int) 4 )) \| ((  1   ) <<  28 )` |
  | `LV_PROPERTY_SPAN_END`       |                                                               |
</ApiMember>

Structs [#structs]

<ApiMember kind="struct" name="_lv_span_coords_t">
  \_lv_span_coords_t [#_lv_span_coords_t]

  Coords of a span

  | Member     | Type                         | Description |
  | ---------- | ---------------------------- | ----------- |
  | `heading`  | <ApiLink name="lv_area_t" /> |             |
  | `middle`   | <ApiLink name="lv_area_t" /> |             |
  | `trailing` | <ApiLink name="lv_area_t" /> |             |
</ApiMember>

Typedefs [#typedefs]

<ApiMember kind="typedef" name="lv_span_coords_t" file="widgets/span/lv_span.h" line="51" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L51">
  lv_span_coords_t [#lv_span_coords_t]

  ```c title=" " lineNumbers=1
  typedef struct _lv_span_coords_t lv_span_coords_t
  ```

  Coords of a span
</ApiMember>

Variables [#variables]

<ApiMember kind="variable" name="lv_spangroup_class" file="widgets/span/lv_span.h" line="53" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/span/lv_span.h#L53">
  lv_spangroup_class [#lv_spangroup_class]

  ```c title=" " lineNumbers=1
  const lv_obj_class_t lv_spangroup_class
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_obj.h&#x22;, &#x22;lv_observer.h&#x22;, &#x22;lv_obj_property.h&#x22;]" includedBy="[&#x22;lv_span_private.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_array.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_bidi.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_display.h&#x22;, &#x22;lv_draw.h&#x22;, &#x22;lv_draw_arc.h&#x22;, &#x22;lv_draw_blur.h&#x22;, &#x22;lv_draw_buf.h&#x22;, &#x22;lv_draw_image.h&#x22;, &#x22;lv_draw_label.h&#x22;, &#x22;lv_draw_line.h&#x22;, &#x22;lv_draw_rect.h&#x22;, &#x22;lv_draw_triangle.h&#x22;, &#x22;lv_event.h&#x22;, &#x22;lv_ext_data.h&#x22;, &#x22;lv_flex.h&#x22;, &#x22;lv_font.h&#x22;, &#x22;lv_fs.h&#x22;, &#x22;lv_grad.h&#x22;, &#x22;lv_grid.h&#x22;, &#x22;lv_group.h&#x22;, &#x22;lv_image_decoder.h&#x22;, &#x22;lv_image_dsc.h&#x22;, &#x22;lv_indev.h&#x22;, &#x22;lv_layout.h&#x22;, &#x22;lv_ll.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_matrix.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_obj_class.h&#x22;, &#x22;lv_obj_draw.h&#x22;, &#x22;lv_obj_event.h&#x22;, &#x22;lv_obj_pos.h&#x22;, &#x22;lv_obj_property_names.h&#x22;, &#x22;lv_obj_scroll.h&#x22;, &#x22;lv_obj_style.h&#x22;, &#x22;lv_obj_style_gen.h&#x22;, &#x22;lv_obj_tree.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_profiler.h&#x22;, &#x22;lv_profiler_builtin.h&#x22;, &#x22;lv_sprintf.h&#x22;, &#x22;lv_string.h&#x22;, &#x22;lv_style.h&#x22;, &#x22;lv_style_gen.h&#x22;, &#x22;lv_style_properties.h&#x22;, &#x22;lv_symbol_def.h&#x22;, &#x22;lv_text.h&#x22;, &#x22;lv_tick.h&#x22;, &#x22;lv_timer.h&#x22;, &#x22;lv_types.h&#x22;]" />
