Page 1 of 1

Set font size

Posted: 2007-09-19T01:35:38-07:00
by niketa
I want to set font size automatically. It depends on text length and image height and width. How can I calculate font size like this so that text will be best fit in image.

Re: Set font size

Posted: 2007-09-19T03:31:26-07:00
by mkoppanen
niketa wrote:I want to set font size automatically. It depends on text length and image height and width. How can I calculate font size like this so that text will be best fit in image.
Take a look at the Imagick::queryFontMetrics method.

Re: Set font size

Posted: 2007-09-19T04:36:40-07:00
by niketa
I was trying to use this method queryFontMetrics(). It gives me Fatal error: Call to undefined method Imagick::QueryFontMetrics()

Re: Set font size

Posted: 2007-09-19T13:38:28-07:00
by mkoppanen
Either you are running a very old version of Imagick or you have a typo somewhere.