---
name: "TTF_GetTextFont"
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_GetTextFont"
---

# TTF\_GetTextFont(3)

Get the font used by a text object.

## NAME

TTF\_GetTextFont - Get the font used by a text object.

## HEADER FILE

Defined in SDL3\_ttf/SDL\_ttf.h

## SYNOPSIS

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

**TTF\_Font \* TTF\_GetTextFont(TTF\_Text \*text);**

## FUNCTION PARAMETERS

- *text*

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

## RETURN VALUE

( **TTF\_Font**\
  \*) Returns the  **TTF\_Font**\
  used by the text on success or NULL 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.

## SEE ALSO

**•**(3), [**TTF\_SetTextFont**(3)](/TTF_SetTextFont/3.md)
