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
- debian bookworm: pslib-dev 0.4.7-1+b1
- debian trixie: pslib-dev 0.4.8-1+b1
- ubuntu jammy: pslib-dev 0.4.7-1
- ubuntu noble: pslib-dev 0.4.7-1build2
- ubuntu questing: pslib-dev 0.4.8-1
- ubuntu resolute: pslib-dev 0.4.8-1build1
- ubuntu stonking: pslib-dev 0.4.8-3 ยท GPL-2.0-or-later OR LGPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms