beowulfdk
03-01-2008, 01:30 PM
Hi,
Does anyone know of an algoritm that will give an indication of the width of a text string rendered with a typical true type font? What I mean is a way of getting an indicator (not actual pixel width) of how wide the string will be.
My problem is user names, on a site of mine, breaking the design when they've used certain wide characters or the full number of chars allowed in user names. Being able to get an indication of the width of a user name would enable me to force shortening certain user names when showing them.
Does anyone know of an algoritm that will give an indication of the width of a text string rendered with a typical true type font? What I mean is a way of getting an indicator (not actual pixel width) of how wide the string will be.
My problem is user names, on a site of mine, breaking the design when they've used certain wide characters or the full number of chars allowed in user names. Being able to get an indication of the width of a user name would enable me to force shortening certain user names when showing them.
