---
name: "TTF_SetFontDirection"
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_SetFontDirection"
---

# TTF\_SetFontDirection(3)

Set the direction to be used for text shaping by a font.

## NAME

TTF\_SetFontDirection - Set the direction to be used for text shaping by a font.

## HEADER FILE

Defined in SDL3\_ttf/SDL\_ttf.h

## SYNOPSIS

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

**bool TTF\_SetFontDirection(TTF\_Font \*font, TTF\_Direction direction);**

## DESCRIPTION

This function only supports left-to-right text shaping if SDL\_ttf was not built with HarfBuzz support.

This updates any  **TTF\_Text**\
  objects using this font.

## FUNCTION PARAMETERS

- *font*

  the font to modify.

- *direction*

  the new direction for text to flow.

## 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 font.

## AVAILABILITY

This function is available since SDL\_ttf 3.0.0.
