---
name: "TTF_SetFontStyle"
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_SetFontStyle"
---

# TTF\_SetFontStyle(3)

Set a font's current style.

## NAME

TTF\_SetFontStyle - Set a font's current style.

## HEADER FILE

Defined in SDL3\_ttf/SDL\_ttf.h

## SYNOPSIS

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

**void TTF\_SetFontStyle(TTF\_Font \*font, TTF\_FontStyleFlags style);**

## DESCRIPTION

This updates any  **TTF\_Text**\
  objects using this font, and clears already-generated glyphs, if any, from the cache.

The font styles are a set of bit flags, OR'd together:

•  **TTF\_STYLE\_NORMAL** (is zero)

•  **TTF\_STYLE\_BOLD**

•  **TTF\_STYLE\_ITALIC**

•  **TTF\_STYLE\_UNDERLINE**

•  **TTF\_STYLE\_STRIKETHROUGH**

## FUNCTION PARAMETERS

- *font*

  the font to set a new style on.

- *style*

  the new style values to set, OR'd together.

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

## SEE ALSO

**•**(3), [**TTF\_GetFontStyle**(3)](/TTF_GetFontStyle/3.md)
