PS_STRINGWIDTH2(3)

πŸ’– PS_STRINGWIDTH2 πŸ’–

okay bestie, so this one lives in the Library Functions Manual, and its whole entire job? measuring strings. that's it. that's the vibe. ✨


🌸 NAME 🌸

PS_stringwidth2 β€” gets the width of a string, no cap 🫢


πŸŽ€ SYNOPSIS πŸŽ€

#include <pslib.h>

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

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, this function calculates the width of a string in points, assuming it got output in the font you specify and at the font size you specify. it's giving "how much horizontal space is this text gonna eat up" energy πŸ’…

it will not consider more than len characters. so if your string is a whole novel and you only want the first len of it measured, that's literally what len is for, bestie.

here's the tea though πŸ“: this function needs an Adobe font metrics file to calculate the precise width. no metrics file, no precision. that's just how it is, periodt.

and oh β€” if kerning is turned on, it will be taken into account. kerning girlies, this one's for you 😌✨


πŸ‘‘ RETURN VALUE πŸ‘‘

the width of a string, in points. that's the whole gift. 🎁


🌈 SEE ALSO 🌈

iykyk, go read those next πŸ’œ


🧚 AUTHOR 🧚

this manual page was written by Uwe Steinmann uwe@steinmann.cx. absolute icon behavior, we love to see it πŸ’–


and that's the whole page, bestie!! this was PS_STRINGWIDTH2(3) from the Library Functions Manual β€” go forth and measure your strings responsibly, mwah πŸ’‹βœ¨πŸ¦‹

πŸ“¦ where this page comes from