TTF_RenderGlyph_Solid(3)

✨ TTF_RenderGlyph_Solid(3) ✨

okay bestie, welcome to the TTF_RenderGlyph_Solid page, part of the SDL_ttf3 FUNCTIONS lineup πŸ’–


NAME πŸ’…

TTF_RenderGlyph_Solid β€” render a single 32-bit glyph at fast quality to a new 8-bit surface. no cap, that's literally the whole job πŸŽ€


HEADER FILE πŸ¦‹

Defined in SDL3_ttf/SDL_ttf.h


SYNOPSIS 🌸

#include "SDL3_ttf/SDL_ttf.h"

SDL_Surface * TTF_RenderGlyph_Solid(TTF_Font *font, Uint32 ch, SDL_Color fg);

DESCRIPTION πŸ‘‘

So this function is gonna allocate a whole new 8-bit, palettized surface for you. The surface's 0 pixel becomes the colorkey, which is the way it gives you a transparent background. And the 1 pixel? That gets set to the text color. iconic behavior honestly πŸ’…

The glyph is rendered with no padding and no centering in the X direction, and it's aligned normally in the Y direction. that's it, that's the tea β˜•

If you wanna render at other quality levels, you can, and the options are:

  • TTF_RenderGlyph_Shaded
  • TTF_RenderGlyph_Blended
  • TTF_RenderGlyph_LCD

pick your fighter 🫢


FUNCTION PARAMETERS πŸ“

  • font β€” the font you're rendering with.
  • ch β€” the character you wanna render.
  • fg β€” the foreground color for the text.

RETURN VALUE ⭐

Returns a new 8-bit, palettized surface πŸ’– … or NULL if there was an error 😭 (we don't talk about the error path).


THREAD SAFETY 🧚

This function should be called on the thread that created the font. fr fr, don't be out here calling it from a random thread, that's not the vibe πŸ™ˆ

AVAILABILITY 🌈

This function is available since SDL_ttf 3.0.0. she's been here a minute ✨


SEE ALSO πŸ”₯


and that's the whole page, bestie πŸŽ€ this one's from SDL_ttf, version SDL_ttf 3.2.2, so go forth and render that single 32-bit glyph at fast quality πŸ’–βœ¨πŸ¦‹πŸ’… periodt.

πŸ“¦ where this page comes from