Hi -- thanks for the help.
I actually found out that my issue was that some fonts were defined in a "
ghostscript.xml" file in my ImageMagick directory which were pointing to
fonts that didn't actually exist on my system (I saw this by using the
"convert -list type" command, and the opening the ghostscript.xml file it
mentioned). When I deleted that file (and applied the below fixes to my test
script) everything worked properly.
On 8/14/07, Beau E. Cox <[EMAIL PROTECTED]> wrote:
>
> On 8/13/07, Eric Adum <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I recently installed ImageMagick 6.3.5 and the corresponding PerlMagick
> > (from source); however, now when I call the QueryFontMetrics method, it
> > returns undef.
> >
> > When I call QueryFont(), I get a list of fonts, so I know that
> ImageMagick
> > can see the font I'm trying to use.
> >
> > For example,
> >
> > #! /usr/bin/perl
> > use Image::Magick;
> > use Data::Dumper;
> > my $img = Image::Magick->new();
> > my @fonts = $img->QueryFont();
> > foreach my $font ( @fonts ) {
> > print Dumper($img->QueryFontMetrics( text => 'Testing 1 2 3', font =>
> > $font ));
> > }
> >
> > returns something like this:
> >
> > $VAR1 = undef;
> > $VAR1 = undef;
> > $VAR1 = undef;
> > $VAR1 = undef;
> > $VAR1 = undef;
> > ...
> >
> > Anyone have an idea of why this could be happening? It was working fine
> in
> > the old version of ImageMagick I was using (6.2.4). Or, any suggestions
> on
> > debugging?
> >
> > Also, all of the demos in PerlMagick/demo work fine (but none of them
> use
> > QueryFontMetrics).
>
> Hi - you need an actual image ( not just the Image::Magick base ) for
> QueryFontMetrics; this works:
>
> #! /usr/bin/perl
> use strict;
> use warnings FATAL => 'all';
> use Image::Magick;
> use Data::Dumper;
> my $img = Image::Magick->new();
> my @fonts = $img->QueryFont();
> $img->Set( size => "100x100" );
> $img->Read( "Xc:white" );
> foreach my $font ( @fonts ) {
> print Dumper( [ $img->QueryFontMetrics( text => 'Testing 1 2 3', font
> =>
> $font ) ] );
> }
>
> Aloha => Beau;
>
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users