On Tue, 2009-12-01 at 10:56 +0000, Steve Fosdick wrote:
For variable text in a proportional width font you could see if you can get access to the font metric information via one of the libraries that handles true-type fonts, i.e. where you can ask the library "If I draw this text at this point size, how wide will it be?" then by successive approximation refine the point size to get the width you want. I know of FreeType as one such library but there may be others.
Further to this I would try to use the same type library as ImageMagick uses. If you are not able to call the library directly from PHP and need a write a wrapper program I'd put the successive approximation in the program rather than invoke it multiple times.
Regards, Steve.