---
name: "TTF_GetGlyphMetrics"
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_GetGlyphMetrics"
---

# TTF\_GetGlyphMetrics(3)

Query the metrics (dimensions) of a font's glyph for a UNICODE codepoint.

## NAME

TTF\_GetGlyphMetrics - Query the metrics (dimensions) of a font's glyph for a UNICODE codepoint.

## HEADER FILE

Defined in SDL3\_ttf/SDL\_ttf.h

## SYNOPSIS

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

**bool TTF\_GetGlyphMetrics(TTF\_Font \*font, Uint32 ch, int \*minx, int \*maxx, int \*miny, int \*maxy, int \*advance);**

## DESCRIPTION

To understand what these metrics mean, here is a useful link:

https://freetype.sourceforge.net/freetype2/docs/tutorial/step2.html

## FUNCTION PARAMETERS

- *font*

  the font to query.

- *ch*

  the codepoint to check.

- *minx*

  a pointer filled in with the minimum x coordinate of the glyph from the left edge of its bounding box. This value may be negative.

- *maxx*

  a pointer filled in with the maximum x coordinate of the glyph from the left edge of its bounding box.

- *miny*

  a pointer filled in with the minimum y coordinate of the glyph from the bottom edge of its bounding box. This value may be negative.

- *maxy*

  a pointer filled in with the maximum y coordinate of the glyph from the bottom edge of its bounding box.

- *advance*

  a pointer filled in with the distance to the next glyph from the left edge of this glyph's bounding box.

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