ImageMagick and windows fonts.

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
pva

ImageMagick and windows fonts.

Post by pva »

Hi. In what file(s) ImageMagick hardcodes default font names? Does this default font depends on fontconfig presence or not? Are defaults different for truetype and ghostscript fonts (yes, I think this should be)? Is it hard to add a fallback in the imagemagick code to fall back onto ghostscript if font rendering with windows fonts (truetype) fails?

I'm asking as in Gentoo we had to make ImageMagick depend on windows fonts (corefonts package) but I'd like to make ImageMagick depend on dejavu fonts since Windows fonts license is not nice.

Also it looks like there is bug in configure.ac:

Code: Select all

if test -n "$windows_font_dir"; then
  type_include_files="$type_include_files "'<include file="type-windows.xml" />'
fi
It looks like check should be the following:

Code: Select all

if test "${windows_font_dir}x" != 'x'; then
...
In any way, thanks for great software.
pva

Re: ImageMagick and windows fonts.

Post by pva »

pva wrote:Is it hard to add a fallback in the imagemagick code to fall back onto ghostscript if font rendering with windows fonts (truetype) fails?
Ah, and if I read sources correctly this is already the case. Or are there other places where this is done differently?

Code: Select all

RenderFreetype() {
...
  status=FT_Open_Face(library,&args,draw_info->face,&face);
  if (status != 0)
    {
      (void) FT_Done_FreeType(library);
      (void) ThrowMagickException(&image->exception,GetMagickModule(),
        TypeError,"UnableToReadFont","`%s'",draw_info->font);
      return(RenderPostscript(image,draw_info,offset,metrics));
    }
...
}
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: ImageMagick and windows fonts.

Post by magick »

We can add support to find DejaVU fonts. Look for a patch in ImageMagick 6.5.9-1 beta by tomorrow. Where is the path to the DejaVU fonts on Gentoo?

ImageMagick looks in its font configuration file (i.e. type.xml) for font definitions but it also checks fontconfig(). To see which fonts it has found, type
  • identify -list font
Post Reply