1. Can this method be used for text that is created using SVG's Draw() instead of Annotate()?
2. Does QueryMultilineFontMetrics return the same results of QueryFontMetrics?
According to documentation QueryFontMetrics returns:
* character width
* character height
* ascender
* descender
* text width
* text height
* maximum horizontal advance
* bounds.x1
* bounds.y1
* bounds.x2
* bounds.y2
* origin.x
* origin.y
PerlMagick's QueryFontMetrics
Re: PerlMagick's QueryFontMetrics
The Draw() method calls Annotate() for rendering text so if you are only dealing with text, Annotate() is recommend.
The QueryMultilineFontMetrics() returns the same values as QueryFontMetrics() except the values are relative to a series of text lines whereas QueryFontMetrics() returns font metrics for a single line of text only.
The QueryMultilineFontMetrics() returns the same values as QueryFontMetrics() except the values are relative to a series of text lines whereas QueryFontMetrics() returns font metrics for a single line of text only.
Re: PerlMagick's QueryFontMetrics
OK - I'll use Annotate then.
I'm glad to hear that QueryMultilineFontMetrics takes the same parameters, however, I cannot get it to work correctly:
I get an error:
Is it because I have an old version of PerlMagick?
I'm glad to hear that QueryMultilineFontMetrics takes the same parameters, however, I cannot get it to work correctly:
Code: Select all
#!/usr/bin/perl
use Image::Magick;
use strict;
my ($image, $x_ppem, $y_ppem, $ascender, $descender, $width, $height, $max_advance, $predict);
$image = new Image::Magick;
$image->Set( size=>'1x1' );
$image->ReadImage( 'xc:none' );
($x_ppem, $y_ppem, $ascender, $descender, $width, $height, $max_advance) = $image->QueryMultilineFontMetrics(text=>'A single line of text', font=>'arial.ttf', fill=>'blue', pointsize=>'12' );
Code: Select all
Can't locate auto/Image/Magick/QueryMultil.al in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./roo.pl line 11
Re: PerlMagick's QueryFontMetrics
Looks like you need to upgrade your ImageMagick/PerlMagick distribution. We ran your script without complaint. We're using ImageMagick 6.3.2-4.
Re: PerlMagick's QueryFontMetrics
Please ignore...I replied to the wrong thread and I can't delete this message.