PS_STRINGWIDTH(3)

โœจ PS_STRINGWIDTH(3) โœจ

okay bestie, pull up a chair because we're diving into the Library Functions Manual and today's main character is PS_stringwidth ๐Ÿ’… she's from the pslib girlies and she's here to tell you exactly how wide your text is gonna be. no cap.


๐ŸŒธ NAME ๐ŸŒธ

PS_stringwidth โ€” Get width of a string ๐ŸŽ€


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

#include <pslib.h>

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

๐Ÿ’– DESCRIPTION ๐Ÿ’–

so basically, this function calculates the width of a string in points โ€” as in, the width it would have if you actually output it using the given font and font size. like, hypothetically. she's doing the math so you don't have to ๐Ÿงฎโœจ

here's the tea tho: to calculate the precise width, this function needs an Adobe font metrics file. no metrics file, no precision. iykyk ๐Ÿ“„

and if kerning is turned on? bestie, she's gonna take that into account too. she sees everything ๐Ÿ‘€๐Ÿ’…


๐Ÿซถ RETURN VALUE ๐Ÿซถ

Width of a string in points. that's it, that's the whole vibe. slay ๐Ÿ’–


๐ŸŒˆ SEE ALSO ๐ŸŒˆ

go read those too, they're iconic fr fr ๐Ÿฆ‹


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

This manual page was written by Uwe Steinmann uwe@steinmann.cx. giving credit where credit is due, periodt ๐Ÿ’œ


and that's a wrap on PS_STRINGWIDTH(3) from the Library Functions Manual ๐ŸŽ€ thanks for coming to my ted talk, bestie โ€” go measure some strings, you've got this ๐Ÿ’–โœจ๐ŸŒธ

๐Ÿ“ฆ where this page comes from