TTF_SetFontSize(3)

πŸ’– TTF_SetFontSize β€” bestie's guide to glow-ups for your font πŸ’–

okay so this is a page from the SDL_ttf3 FUNCTIONS manual, and the star of the show is TTF_SetFontSize(3). it's giving "make my text bigger, make it smaller, make it a whole new vibe" and honestly? obsessed. ✨


🌸 NAME 🌸

TTF_SetFontSize β€” change a font's size on the fly, like a ✨dynamic✨ little glow-up. no cap.


πŸŽ€ HEADER FILE πŸŽ€

it lives in SDL3_ttf/SDL_ttf.h, bestie. that's the address. πŸ’…


✨ SYNOPSIS ✨

#include "SDL3_ttf/SDL_ttf.h"

bool TTF_SetFontSize(TTF_Font *font, float ptsize);

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, when you call this, it updates literally every TTF_Text object that's out here using this font β€” they all get the new size, no one left behind πŸ’– β€” and it clears already-generated glyphs, if any, from the cache. so the cache gets a little reset moment. it's fine. it's a vibe check. πŸ”₯


🌈 FUNCTION PARAMETERS 🌈

  • font β€” the font you're resizing. the main character, fr fr. πŸ‘‘
  • ptsize β€” the new point size. the numbers. the drama. the slay. πŸ’…

πŸ’œ RETURN VALUE πŸ’œ

returns true when it goes off without a hitch, and false when it does NOT. 😭 if you get a false, go call SDL_GetError() for the tea β€” it'll tell you what went wrong.


🧚 THREAD SAFETY 🧚

⚠️ bestie listen β€” call this on the thread that created the font. same thread, always. don't be texting from someone else's phone, okay? πŸ™ˆ

⭐ AVAILABILITY ⭐

this one's been around since SDL-ttf 3.0.0. iconic behavior, honestly. it's not new new, it's a classic. 🫢


πŸ“ SEE ALSO πŸ“

  • β€’(3)
  • TTF_GetFontSize(3) β€” the girl who tells you what size you're currently at πŸ’–

and that's the whole page, no notes. πŸ’€βœ¨

mwah πŸ’‹ this came from the SDL_ttf manual, version SDL_ttf 3.2.2, and the page itself is TTF_SetFontSize(3). go forth and resize, my love. πŸŒΈπŸŽ€πŸ¦‹
πŸ“¦ where this page comes from