How to know size of text with Mogrify?
Posted: 2013-12-17T14:34:02-07:00
I want to write some text to an Image with Mogrify. I am using a wrapper around Mogrify for Ruby called Minimagick, and my code looks like this:
Somehow it would be great to know how much width and height that text is going to take. I would like that to avoid the text to be cut by the end of the image that is being drawn to. Is there anyway I can know which width/height a particular text with particular pointsize will take?
Thanks
Code: Select all
composed_image.combine_options do |c|
c.fill(price_color)
c.pointsize '24'
c.draw "text 30,40 'Hi this is my text'"
end
Thanks