"Unable to read font `any' and blocky fonts at 6.6.7 Mac

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
gje21c
Posts: 4
Joined: 2011-02-20T14:39:18-07:00
Authentication code: 8675308

"Unable to read font `any' and blocky fonts at 6.6.7 Mac

Post by gje21c »

Hi,

The old font problem again ! Sorry about this, but I have researched a lot and tried pretty hard on this one.

In summary, I can only get a few fallback fonts from IM, and at 6.6.7 they're aliased, but at 6.6.3 they're smooth.

Everything below is latest rev as at 20 Feb 2011.

So, at IM 6.6.7 on Mac OS X 10.6.6, the command
convert white.png -debug annotate -pointsize 18 -antialias -gravity Center 'label:blah' -append out.png

gives "unable to read font `(null)' @ error/annotate.c/RenderFreetype/1115" but does put in a blocky/aliased Times font.

If I specify -font Times (or another similar Serif font) , or Courier (or another fixed-width font) or Helvetica/Arial I get a version of Times, or Courier, or Helvetica. I can use TimesBold and get a blocky Times-ish bold font, so looks like IM is using the best match it can come up with from it's own fallback fonts, good.

At IM 6.6.3 I get the same, but the fallback font is nicely antialiased and quite ok. Flag "-antialias" doesn't help at 6.6.7.

"convert -list font" prints nothing.


IM is installed in both cases (6.6.3 and 6.6.7) from the binary download. I have built and installed GhostScript 9.01. (9.00 had the same issues). I have built and installed freetype 2.4.4 in case that was the problem with

# wget http://sourceforge.net/projects/freetyp ... .4.tar.bz2
# bunzip2 freetype-2.4.4.tar.bz2
# tar xvf freetype-2.4.4.tar
# cd freetype-2.4.4
# ./configure
# make
# sudo make install

and similarly for GhostScript, ie. everything default. All locally built stuff is going to default locations like /usr/local/lib, /usr/local/share.

IM config is:

convert -list configure

Path: /Users/gedwards/tools/imagemagick/ImageMagick-6.6.7/lib/ImageMagick-6.6.7/config/configure.xml

Name Value
-------------------------------------------------------------------------------
CC gcc -std=gnu99 -std=gnu99
CFLAGS -D_THREAD_SAFE -D_THREAD_SAFE -pthread -fopenmp -g -O2 -Wall -D_THREAD_SAFE -pthread
CONFIGURE ./configure '--disable-dependency-tracking' '--disable-installed' '--enable-delegate-build' '--enable-shared' '--disable-static' '--without-rsvg' '--without-gslib' '--without-gvc' '--without-wmf' '--without-frozenpaths' '--prefix=/ImageMagick-6.6.7'
COPYRIGHT Copyright (C) 1999-2011 ImageMagick Studio LLC
CPPFLAGS -I/ImageMagick-6.6.7/include/ImageMagick
CXX g++
CXXFLAGS -g -O2 -D_THREAD_SAFE -pthread
DEFS -DHAVE_CONFIG_H
DELEGATES bzlib freetype jpeg jng lcms png tiff x11 xml zlib
DISTCHECK_CONFIG_FLAGS --disable-deprecated --disable-installed --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-gslib=no --with-fontpath= --with-gvc=no --with-rsvg=no --with-wmf=no --with-perl=no
EXEC-PREFIX /ImageMagick-6.6.7
FEATURES OpenMP
HOST x86_64-apple-darwin10.6.0
LDFLAGS -L/ImageMagick-6.6.7/lib -L/Users/cristy/ImageMagick-6.6.7-5/jpeg/.libs -L/Users/cristy/ImageMagick-6.6.7-5/jpeg -L/Users/cristy/ImageMagick-6.6.7-5/lcms/src/.libs -L/Users/cristy/ImageMagick-6.6.7-5/lcms/src -L/Users/cristy/ImageMagick-6.6.7-5/magick -L/Users/cristy/ImageMagick-6.6.7-5/png/.libs -L/Users/cristy/ImageMagick-6.6.7-5/png -L/Users/cristy/ImageMagick-6.6.7-5/tiff/libtiff/.libs -L/Users/cristy/ImageMagick-6.6.7-5/tiff/libtiff -L/Users/cristy/ImageMagick-6.6.7-5/ttf/objs/.libs -L/Users/cristy/ImageMagick-6.6.7-5/ttf/objs -L/Users/cristy/ImageMagick-6.6.7-5/wand -L/Users/cristy/ImageMagick-6.6.7-5/wmf/src/.libs -L/Users/cristy/ImageMagick-6.6.7-5/wmf/src -L/Users/cristy/ImageMagick-6.6.7-5/xml/.libs -L/Users/cristy/ImageMagick-6.6.7-5/xml -L/usr/X11/lib -R/usr/X11/lib
LIB_VERSION 0x667
LIB_VERSION_NUMBER 6,6,7,5
LIBS -lMagickCore -llcms -ltiff -lfreetype -ljpeg -lpng -lXext -lXt -lSM -lICE -lX11 -lbz2 -lxml2 -lz -lm -lgomp -lclparser -Wl,-framework,OpenCL -L/System/Library/Frameworks/OpenCL.framework/Versions/A/Libraries -lm -lpthread
NAME ImageMagick
PCFLAGS -fopenmp
PREFIX /ImageMagick-6.6.7
QuantumDepth 16
RELEASE_DATE 2011-02-06
VERSION 6.6.7
WEBSITE http://www.imagemagick.org

Path: [built-in]

Name Value
-------------------------------------------------------------------------------
NAME ImageMagick


Relevant env vars are:

MAGICK_HOME=/Users/gedwards/tools/imagemagick/ImageMagick-6.6.7
DYLD_LIBRARY_PATH=/Users/gedwards/tools/imagemagick/ImageMagick-6.6.7/lib:/usr/OpenMotif/lib

GS_LIB=/usr/local/share/ghostscript/9.01/lib/fonts:/usr/local/share/ghostscript/9.01/lib
GS_FONTPATH=/usr/local/share/ghostscript/9.01/lib/fonts


I tried adding /usr/local/lib to the DYLD_LIBRARY_PATH but then IM spewed errrors about not find jpeg stuff:
May as well include that trace:

DYLD_LIBRARY_PATH=/Users/gedwards/tools/imagemagick/ImageMagick-6.6.7/lib:/usr/OpenMotif/lib:/usr/local/lib

dyld: Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
Expected in: /usr/local/lib/libJPEG.dylib
in /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
Trace/BPT trap


There is a libjpeg there from some old work trying to use a local version of libjpeg with Perl GD::Graph module

$ ls /usr/local/lib
liba2ps.a libfuse.dylib libgd.dylib
liba2ps.la libfuse.la libgd.la
libfreetype.6.dylib libfuse_ino64.2.7.3.dylib libjpeg.8.dylib
libfreetype.a libfuse_ino64.2.dylib libjpeg.a
libfreetype.dylib libfuse_ino64.dylib libjpeg.dylib
libfreetype.la libfuse_ino64.la libjpeg.la
libfuse.0.dylib libgd.2.0.0.dylib pkgconfig
libfuse.2.7.3.dylib libgd.2.dylib
libfuse.2.dylib libgd.a

So I moved all jpeg stuff out if /usr/local/lib, and now IM is back to as was, ie. works can only deliver a few blocky fonts at 6.6.7.


I'll stop there before I bore everyone to death.

Help very much appreciated.

Rgds,

Greg E
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: "Unable to read font `any' and blocky fonts at 6.6.7 Mac

Post by fmw42 »

I am not an expert here, but you may have to reset your type.xml file by using Anthony's imagick_type_gen.pl script at http://www.imagemagick.org/Usage/scripts/

Have you tried specifying the full path to the font you want to use to see if that does any better?
gje21c
Posts: 4
Joined: 2011-02-20T14:39:18-07:00
Authentication code: 8675308

Re: "Unable to read font `any' and blocky fonts at 6.6.7 Mac

Post by gje21c »

Hi,

Many thanks to fmw42. I built my ~/.magick/type.xml file with imagick_type_gen.pl and now all works fine. Tons of fonts and all anti-aliased.

I didn't have any type.xml file anywhere, didn't know I needed it, despite some references to it in these forums and elsewhere. I'm surprised ImageMagick install doesn't build it, or that ImageMagick runtime doesn't warn that you don't have one ! Maybe I missed the words on this in the install bumf.

Thaaaanks !
Greg E
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: "Unable to read font `any' and blocky fonts at 6.6.7 Mac

Post by fmw42 »

On my Mac a default type.xml file was created by the install, but on the Mac it is elsewhere as there is no ~/.magick directory. I had to manually copy the file created by the script and replace the original one with the new one. I am not sure why there is no ~/.magick directory, but once copied to the right place all worked fine. On Linux things may be different.
Post Reply