---
name: "TTF_GetTextSubStringForLine"
section: "3"
platform: "linux"
package: "libsdl3-ttf-doc"
version: "3.2.2+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/TTF_GetTextSubStringForLine"
---

# TTF\_GetTextSubStringForLine(3)

Get the substring of a text object that contains the given line.

## NAME

TTF\_GetTextSubStringForLine - Get the substring of a text object that contains the given line.

## HEADER FILE

Defined in SDL3\_ttf/SDL\_ttf.h

## SYNOPSIS

```
#include "SDL3_ttf/SDL_ttf.h"
```

**bool TTF\_GetTextSubStringForLine(TTF\_Text \*text, int line, TTF\_SubString \*substring);**

## DESCRIPTION

If **line** is less than 0, this will return a zero length substring at the beginning of the text with the

**TTF\_SUBSTRING\_TEXT\_START**\
  flag set. If **line** is greater than or equal to **text-\>num\_lines** this will return a zero length substring at the end of the text with the

**TTF\_SUBSTRING\_TEXT\_END**\
  flag set.

## FUNCTION PARAMETERS

- *text*

  the  **TTF\_Text**\
    to query.

- *line*

  a zero-based line index, in the range \[0 .. text-\>num\_lines-1\].

- *substring*

  a pointer filled in with the substring containing the offset.

## RETURN VALUE

Returns true on success or false on failure; call SDL\_GetError() for more information.

## THREAD SAFETY

This function should be called on the thread that created the text.

## AVAILABILITY

This function is available since SDL\_ttf 3.0.0.
