Skrevet av Emne: Image::Magick can't find its fonts  (Lest 4255 ganger)

ATC

  • Gjest
Image::Magick can't find its fonts
« på: 27. ſeptember 2008, 18:24 pm »
  • [applaud]0
  • [smite]0
  • When trying to use the "Annotate" function in Image::Magick, no text appears and the result string yields an error message complaining that the specified font can not be found in "/usr/share/ghostscript/fonts"



    ATC

    • Gjest
    [Solved] Image::Magick can't find its fonts
    « Svar #1 på: 27. ſeptember 2008, 18:24 pm »
  • [applaud]0
  • [smite]0
  • This is a brainfart by Redhat. First of all, the Annotate feature relies on the package "ghostscript-fonts" to be installed. Secondly, after installing that package the fonts live in a completely different directory.

    Fix the problem by creating a symbolic link like this:
    "ln -s /usr/share/fonts/default/Type1 /usr/share/ghostscript/fonts"

    Finally, make sure that you are in fact referring to a font known to Image::Magick. You can get a list of supported fonts using the following Perl script:

    #!/usr/bin/perl
    use Image::Magick;
    my $image = Image::Magick->new();
    my @fonts = $image->QueryFont();
    foreach $font (@fonts) { print $font . "\n"; }