Image::Magick with a call to QueryFontMetrics should do the job.

Ben Davis


-----Original Message-----
From: Martin Moss [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 04, 2003 7:03 AM
To: Ken Y. Clark
Cc: [EMAIL PROTECTED]
Subject: Re: font width to pixel width in perl - but also offtopic in
javascript

Thanks,

I may well have found a solution within javascript, which is then user end
calculated, so more efficient and reliable,

But thanks I'll remember GD for later use:-)

Marty
----- Original Message ----- 
From: "Ken Y. Clark" <[EMAIL PROTECTED]>
To: "Martin Moss" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, June 04, 2003 2:55 PM
Subject: Re: font width to pixel width in perl - but also offtopic in
javascript


| On Wed, 4 Jun 2003, Martin Moss wrote:
|
| > Date: Wed, 4 Jun 2003 14:46:52 +0100
| > From: Martin Moss <[EMAIL PROTECTED]>
| > To: [EMAIL PROTECTED]
| > Subject: font width to pixel width in perl - but also offtopic in
| >     javascript
| >
| > Hi All,
| >
| > I'm sure this can't be an issue that hasn't been tackled, but I couldn't
| > find anything in the archives so:-
| >
| > I'm trying to find a way in which I can calculate the pixel width of a
| > string in a given font.
| > I'm doing this to feed a javascript file, so I am also looking at doing
this
| > in javascript also.
| >
| > currently all I can find is the php 'imagefontwidth' function. Does
anybody
| > know of an equivalent in perl?
| > I remember having issues like this in TK, but not sure the solution
there
| > would be appropriate.
| >
| > I guess this is fuzzily on topic, but if anybody has any off topic
| > experience I'd be greatful. any approx solutions which can 'guarentee' a
| > 'larger than the minimum space required' would also suffice, e.g. is
there
| > an approximation which I can use based upon the maximum character width
| > possible for a font etc...
| >
| > Regards
| >
| > Marty
|
| Just a wild guess, but perhaps you could load GD.pm and get various
| font widths from there?
|
| ky
|

Reply via email to