S3D_STRLEN(3)

πŸ’– S3D_STRLEN(3) πŸ’–

okay bestie, welcome to the s3d Manual ✨ this one's short and sweet, but it's a lowkey essential little vibe check for your text rendering, fr fr πŸŽ€


🌸 NAME 🌸

s3d_strlen β€” get rendered string size πŸ’…


✨ SYNOPSIS ✨

#include <s3d.h>

float s3d_strlen(const char *str);

like, that's it. one function, one string, one float coming back at you 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• β€” s3d_strlen returns the length of the string if it were rendered with the currently selected font. not the number of characters, bestie, the actual rendered size. it's giving "how much space will this text take up" energy πŸ‘‘

and why do you care? because it's genuinely useful to estimate the size used for a text, so you can render the background or the bounding box before you insert the text itself. like, draw the cute lil box first, then the words go in. main character planning behavior, honestly πŸ’…βœ¨

no cap: the font that matters here is whatever font is currently selected at the moment you call it. change the font, the answer changes too πŸ™ˆ

πŸ‘‘ AUTHOR πŸ‘‘

Simon Wunderlich Author of s3d 🌟


and that's the whole page, bestie!! short king of a manpage, but it ate πŸ’– thanks for reading, mwah 🫢

signing off from the s3d manual, page S3D_STRLEN(3) β€” no date stamp on this one, so just imagine me blowing a lil kiss goodbye πŸ˜­πŸ’•