TTF_FontIsFixedWidth(3)
π TTF_FontIsFixedWidth(3) π
okay bestie, welcome to the SDL_ttf3 FUNCTIONS corner of the manual, where we answer the age-old question: is this font giving grid, or is it giving chaos? β¨
πΈ NAME πΈ
TTF_FontIsFixedWidth β the lil function that queries whether a font is fixed-width. π
π HEADER FILE π
Defined in SDL3_ttf/SDL_ttf.h. she lives there. that's her home. π
β¨ SYNOPSIS β¨
#include "SDL3_ttf/SDL_ttf.h"
bool TTF_FontIsFixedWidth(const TTF_Font *font);
look at her. one parameter. returns a bool. no notes. π
π DESCRIPTION π
so like, a "fixed-width" font means all glyphs are the same width across. every single one. no cap. a lowercase 'i' will be the same size across as a capital 'W', for example. like, the i is out here taking up the exact same amount of horizontal real estate as the W. iconic behaviour honestly. π
this is common for terminals and text editors, and other apps that treat text as a grid. it's giving spreadsheet. it's giving "everything lines up perfectly." π
most other things (WYSIWYG word processors, web pages, etc) are more likely to not be fixed-width in most cases. those are the proportional girlies. they do their own thing. π¦
π«Ά FUNCTION PARAMETERS π«Ά
fontβ the font to query. that's it. that's the whole vibe check. you hand her a font, she tells you the truth. π
β RETURN VALUE β
Returns true if the font is fixed-width, false otherwise. yes ma'am, binary. no maybe. no "it depends." she said periodt. π
π§ THREAD SAFETY π§
It is safe to call this function from any thread. literally any of them. go wild. call it from all of them at once, she does not care, she is unbothered, she is moisturised, she is in her lane. π₯
π AVAILABILITY π
This function is available since SDL_ttf 3.0.0. so if you're on something older... bestie. update. π
ok real talk though β this is a query function, it does not mutate anything, it does not allocate, it just tells you a fact about a font. use it to decide whether you can do cute grid math or whether you gotta measure every string like a peasant. iykyk. π
mwah π sending u off with love from the SDL_ttf manual, version 3.2.2, brought to you by the SDL_ttf girlies. go forth and align ur text. πβ¨π
π¦ 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