PS_STRINGWIDTH3(3)

πŸ’– PS_STRINGWIDTH3 β€” Library Functions Manual πŸ’–

okay bestie, this is the manual page for PS_STRINGWIDTH3(3) and honestly? she's a little niche but she serves. pslib string geometry, no cap. let's get into it πŸ¦‹


✨ NAME ✨

PS_string_geometry β€” Gets geometry of a string πŸ“


🌸 SYNOPSIS 🌸

#include <pslib.h>

float PS_string_geometry(PSDoc *psdoc, const char *text, int len, int
fontid, float size, float *dimension)

like, that's the whole thing. six args. she's committed. πŸ’…


πŸ’« DESCRIPTION πŸ’«

so here's the tea: this function is identical to PS_stringwidth2(3), fr fr, literally the same vibe β€” except she has one extra parameter, dimension, and if that baby is not NULL, it gets used to hand back even more dimensions of the string. extra intel. bonus content. the director's cut. πŸ‘‘

here's what comes back in the array, bestie, write it down:

  • dimension[0] contains the width as returned by the function 🌈
  • dimension[1] contains the maximum descender πŸ“‰
  • dimension[2] contains the maximum ascender πŸ“ˆ

so yeah, three slots of geometry. width, how far down she goes, how far up she goes. iconic.

lowkey important: if dimension is NULL, none of that array stuff happens. so don't go dereferencing a NULL pointer, that's giving πŸ’€ not it.

🫢 RETURN VALUE 🫢

Width of a string in points. that's the number she gives you back. periodt. ✨


πŸŽ€ SEE ALSO πŸŽ€

go read those too, they're the prequels bestie, iykyk πŸ’–


πŸ‘‘ AUTHOR πŸ‘‘

This manual page was written by Uwe Steinmann uwe@steinmann.cx. give credit where credit is due, always. 🌟


and that's a wrap on PS_STRINGWIDTH3(3) from the Library Functions Manual β€” mwah, no notes, go measure some strings and slay πŸ’…πŸ’œ

πŸ“¦ where this page comes from