On Thu, 20 Apr 2006 14:28:10 -0400, Gabe Schaffer wrote:

Hi Gabe

>> I thought I could modify my type-windows.mgk but it doesn't seem
>> to work... magick++ returns "UnableToReadFont".

There is no need to edit any ImageMagick files, at least for Perl :-).

Just drag the font file into c:\winnt\fonts (or whatever it is on your PC), and 
you'll see a little window pop up, telling you Windows is installing the font, 
not just copying it. Windows monitors all files moved into and out of this 
directory. Once installed, the font can be used in any application.

> Does it work if you pass the complete name ("c:\myfonts\font.ttf")
> as the font name?

That works. I used c:\winnt\fonts\cry.ttf, for the font named 'Cry Uncial', 
since the file name is cry.ttf.

However, because the font name has a space in it, I had to say
(in Perl's Annotate method call) font => 'Cry-Uncial'. Notice how the space is 
replaced by a hyphen to get the font name (not file name) recognized.

Note: When the font cannot be found, IM reverts to a generic font which is 
shipped with IM.

Tested code:
-----><8-----
#!/usr/bin/perl
#
# Note:
#       tab = 4 spaces || die.

use strict;
use warnings;

use Image::Magick;

# -----------

my($image)      = Image::Magick -> new(size => '800 x 700');
my($result)     = $image -> Read('xc:white');

die $result if $result;

my($y) = 5;

for
(
        'c:\winnt\fonts\Cry.ttf',       # Works.
        'c:\winnt\fonts\Cry',           # Fails.
        'Cry.ttf',                                      # Fails.
        'Cry',                                          # Fails.
        'Cry Uncial',                           # Fails.
        'Cry-Uncial',                           # Works.
)
{
        $y += 40;

        $result = $image -> Annotate
        (
                font            => $_,
                text            => 'Celtic Font is "Cry Uncial"',
                pointsize       => 20,
                stroke          => 'Red',
                strokewidth     => 1,
                x                       => 50,
                y                       => $y,
        );

        die $result if $result;
}

$result = $image -> Write('cry.png');

die $result if $result;
-----><8-----

-- 
Cheers
Ron Savage, [EMAIL PROTECTED] on 21/04/2006
http://savage.net.au/index.html
Let the record show: Microsoft is not an Australian company



_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to