the_0ne has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks, have a question that I'm not sure can be answered easily. I'd like to be able to figure out the length of a string by pixels. I know this is a very hard question because there are a lot of parameters that come into play, like which font, OS, browser, blah, blah... But I'm trying to get at a more general answer. I'd like to be able to find out the length of the word WAS is greater in length, because of W usually being the largest font character, than was. So, it'd be great to have a function that would tell me 'WAS' is 20 pixels and 'was' is 15 pixels.
I did find a post while googling showing a person that tried it through a gimp module. But not sure if that's the best way, I've never even used the Gimp before.
Thanks in advance Monks...
UPDATE:Sorry Monks, I didn't explain why I needed this. I am creating pdf's and I need to calculate space for a certain part of a pdf document I am creating. So, the calculation by pixels will tell me how far I can go with the text, where the left position can start, and if I have to split the line into smaller parts. Thanks again.
I did find a post while googling showing a person that tried it through a gimp module. But not sure if that's the best way, I've never even used the Gimp before.
Thanks in advance Monks...
UPDATE:Sorry Monks, I didn't explain why I needed this. I am creating pdf's and I need to calculate space for a certain part of a pdf document I am creating. So, the calculation by pixels will tell me how far I can go with the text, where the left position can start, and if I have to split the line into smaller parts. Thanks again.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Font size by pixels.
by Corion (Patriarch) on Dec 27, 2003 at 21:30 UTC | |
by the_0ne (Pilgrim) on Dec 27, 2003 at 21:57 UTC | |
Re: Font size by pixels.
by BrowserUk (Patriarch) on Dec 27, 2003 at 21:39 UTC | |
Re: Font size by pixels.
by bart (Canon) on Dec 28, 2003 at 00:59 UTC | |
Re: Font size by pixels.
by hanenkamp (Pilgrim) on Dec 27, 2003 at 22:48 UTC |
Back to
Seekers of Perl Wisdom