TTF_CopyFont(3)

✨ TTF_CopyFont(3) ✨

okay bestie, welcome to the SDL_ttf3 FUNCTIONS corner of the manual, you're gonna love it here 🫢


πŸ’– NAME πŸ’–

TTF_CopyFont β€” make a whole entire copy of a font you already have. it's giving "twin but not identical" πŸ’…


🌸 HEADER FILE 🌸

she lives in SDL3_ttf/SDL_ttf.h, no cap ✨


πŸŽ€ SYNOPSIS πŸŽ€

#include "SDL3_ttf/SDL_ttf.h"

TTF_Font * TTF_CopyFont(TTF_Font *existing_font);

πŸ¦‹ DESCRIPTION πŸ¦‹

so the copy you get back is distinct from the original β€” like, separate entity, her own main character energy β€” BUT she shares the same font file, and she's got the exact same size and style as the original. same vibe, different girl. iconic 🌈

when you're done with the TTF_Font she hands you, use

TTF_CloseFont()

to dispose of it. don't just leave her hanging, that's rude 😭


πŸ’œ FUNCTION PARAMETERS πŸ’œ

  • existing_font β€” the font you wanna copy. the original. the blueprint. the moment πŸ‘‘

⭐ RETURN VALUE ⭐

(TTF_Font *) β€” returns a valid TTF_Font, or NULL on failure. and if it's NULL? call SDL_GetError() for more info, she'll tell you what went wrong πŸ’€


🧚 THREAD SAFETY 🧚

this function should be called on the thread that created the original font. same thread, always. don't be messy about it 🚫🧡

🌸 AVAILABILITY 🌸

available since SDL_ttf 3.0.0, so she's been around, she's established, she's got seniority πŸ’…


πŸ”₯ SEE ALSO πŸ”₯


okay that's the whole page bestie, go forth and copy fonts responsibly πŸ’–βœ¨

sending you off with love from the SDL_ttf manual, version SDL_ttf 3.2.2 β€” mwah, xoxo πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from