Scroll to navigation

TTF_GlyphMetrics32(3) SDL_ttf3 FUNCTIONS TTF_GlyphMetrics32(3)

NAME

TTF_GlyphMetrics32 - Query the metrics (dimensions) of a font's 32-bit glyph.

HEADER FILE

Defined in SDL3_ttf/SDL_ttf.h

SYNOPSIS

#include "SDL3_ttf/SDL_ttf.h"
SDL_bool TTF_GlyphMetrics32(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

This is the same as TTF_GlyphMetrics (), but takes a 32-bit character instead of 16-bit, and thus can query a larger range. If you are sure you'll have an SDL_ttf that's version 2.0.18 or newer, there's no reason not to use this function exclusively.

FUNCTION PARAMETERS

the font to query.
the character code to check.

RETURN VALUE

Returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() for more information.

AVAILABILITY

This function is available since SDL_ttf 3.0.0.

SDL_ttf 3.0.0 SDL_ttf