---
name: "TTF_GetGlyphImageForIndex"
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_GetGlyphImageForIndex"
---

# TTF\_GetGlyphImageForIndex(3)

Get the pixel image for a character index.

## NAME

TTF\_GetGlyphImageForIndex - Get the pixel image for a character index.

## HEADER FILE

Defined in SDL3\_ttf/SDL\_ttf.h

## SYNOPSIS

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

**SDL\_Surface \* TTF\_GetGlyphImageForIndex(TTF\_Font \*font, Uint32 glyph\_index, TTF\_ImageType \*image\_type);**

## DESCRIPTION

This is useful for text engine implementations, which can call this with the **glyph\_index** in a  **TTF\_CopyOperation**

## FUNCTION PARAMETERS

- *font*

  the font to query.

- *glyph\_index*

  the index of the glyph to return.

- *image\_type*

  a pointer filled in with the glyph image type, may be NULL.

## RETURN VALUE

Returns an SDL\_Surface containing the glyph, or NULL 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.
