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_ShadedTTF_RenderGlyph_BlendedTTF_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
- debian trixie: libsdl3-ttf-doc 3.2.2+ds-1 Β· Zlib
- fedora 43: SDL3_ttf-devel 3.2.2-2.fc43 Β· Zlib AND MIT
- fedora 43: SDL3_ttf-devel 3.2.2-2.fc43 Β· Zlib AND MIT
- fedora 44: SDL3_ttf-devel 3.2.2-4.fc44 Β· Zlib AND MIT
- fedora 44: SDL3_ttf-devel 3.2.2-4.fc44 Β· Zlib AND MIT
- ubuntu questing: libsdl3-ttf-doc 3.2.2+ds-1
- ubuntu resolute: libsdl3-ttf-doc 3.2.2+ds-1build1 Β· Zlib
- ubuntu stonking: libsdl3-ttf-doc 3.2.2+ds-2 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms