Page 1 of 1

ImageMagick and windows fonts.

Posted: 2010-01-21T11:28:46-07:00
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.

Re: ImageMagick and windows fonts.

Posted: 2010-01-21T12:13:30-07:00
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));
    }
...
}

Re: ImageMagick and windows fonts.

Posted: 2010-01-21T12:50:59-07:00
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