I am working with PerlMagick on three different machines, let's say
- A (Solaris, ImageMagick 6.2.6 04/25/06 Q16),
B (Solaris, ImageMagick 6.3.2 02/13/07 Q16) and
C (OpenSolaris, ImageMagick 6.3.4 04/08/09 Q16).
Look at the following test program:
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=>"300x500",
pointsize=>20, font=>"Arial",
antialias=>'true',
density=>"50x50");
$image->Read('xc:none');
($x_ppem, $y_ppem, $ascender, $descender, $width, $height, $max_advance)
= $image->QueryFontMetrics(text=>' ');
print "x_ppem = ", $x_ppem, "\n";
print "y_ppem = ", $y_ppem, "\n";
print "ascender = ", $ascender, "\n";
print "descender = ", $descender, "\n";
print "width = ", $width, "\n";
print "height = ", $height, "\n";
print "max_advance = ", $max_advance, "\n";
Look at the results on machine A
fontsize = 12:
Code: Select all
x_ppem = 8
y_ppem = 8
ascender = 8
descender = -2
width = 2
height = 10
max_advance = 10
Code: Select all
x_ppem = 14
y_ppem = 14
ascender = 13
descender = -3
width = 4
height = 16
max_advance = 17
Look at the results on machine B:
fontsize = 12:
Code: Select all
x_ppem = 8
y_ppem = 8
ascender = 8
descender = -2
width = 1
height = 10
max_advance = 10
Code: Select all
x_ppem = 14
y_ppem = 14
ascender = 13
descender = -3
width = 1
height = 16
max_advance = 17
Look at the results on machine C:
fontsize = 12:
Code: Select all
x_ppem = 8
y_ppem = 8
ascender = 7
descender = -2
width = 0
height = 10
max_advance = 8
Code: Select all
x_ppem = 14
y_ppem = 14
ascender = 11
descender = -4
width = 0
height = 17
max_advance = 14
What's wrong?
I'd like to use QueryFontMetrics to determine if a given text fits into a placeholder and the result should be the same on each machine where I am going to install the software.
Thanks in advance for any help,
Ghostbuster_2009