Page 1 of 1

[SOLVED] "convert -list font" not finding attributes

Posted: 2011-01-03T13:24:33-07:00
by synexis
I'm having a problem with "convert -list font" that is occurring with a new installation of ImageMagick.

The family, style, stretch and weight parameters are not found for my installed fonts.

On my previous installation of 6.6.5-8 on Ubuntu 8.04, I would have seen something like this:

Code: Select all

  Font: Helvetica-Neue-LT-Std-47-Light-Condensed-Oblique
    family: Helvetica NeueT Std
    style: Oblique
    stretch: Condensed
    weight: 300
    glyphs: /usr/local/share/fonts/HelveticaNeueLTStd-LtCnO.otf
Yet on my new installation of 6.6.4-10 on Ubuntu 10.04, I see this:

Code: Select all

  Font: HelveticaNeueLTStd-LtCnO
    family: unknown
    style: Undefined
    stretch: Undefined
    weight: 0
    glyphs: /usr/local/share/fonts/HelveticaNeueLTStd-LtCnO.otf
(I'm don't think the versions of IM or Ubuntu have anything to do with this, but I'm including them anyway)

I used imagick_type_gen to generate an xml file, which is included in type.xml.

The permissions for the xml file, the font directory, and the fonts themselves are the same on both systems.

The XML entries on both systems are the same:

Code: Select all

  <type
     format="otf"
     name="HelveticaNeueLTStd-LtCnO"
     glyphs="/usr/local/share/fonts/HelveticaNeueLTStd-LtCnO.otf"
     />
... and I'm quite sure this is the one it's using, as the font will not show up with "convert -list font" if I remove the entry.

So on both systems, the xml entries do not contain the extra attributes. However, if I manually change the name or add an attribute like "stretch" on the new system, it will show up when using "convert -list font". All this leads me to believe that, somehow, my previous system automatically determined the extra attributes, but for whatever reason it doesn't on the new installation. Any ideas on why that is?

Thank you!!!

Configurations for each version are below for reference:

Old (working):

Code: Select all

Path: /usr/local/lib/ImageMagick-6.6.5/config/configure.xml

Name          Value
-------------------------------------------------------------------------------
CC            gcc -std=gnu99 -std=gnu99
CFLAGS        -I/usr/include/OpenEXR -fopenmp -g -O2 -Wall -pthread
CONFIGURE     ./configure 
COPYRIGHT     Copyright (C) 1999-2010 ImageMagick Studio LLC
CPPFLAGS      -I/usr/local/include/ImageMagick
CXX           g++
CXXFLAGS      -g -O2 -pthread
DEFS          -DHAVE_CONFIG_H
DELEGATES     bzlib djvu fontconfig freetype gvc jpeg jng jp2 lcms openexr png rsvg tiff x11 xml wmf zlib
DISTCHECK_CONFIG_FLAGS --disable-deprecated --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-gslib=no --with-fontpath= --with-perl=no
EXEC-PREFIX   /usr/local
FEATURES      OpenMP 
HOST          x86_64-unknown-linux-gnu
LDFLAGS       -L/usr/local/lib 
LIB_VERSION   0x665
LIB_VERSION_NUMBER 6,6,5,8
LIBS          -lMagickCore -llcms -ltiff -lfreetype -ljasper -ljpeg -lpng -ldjvulibre -lfontconfig -lwmf -lwmflite -lXext -lXt -lSM -lICE -lX11 -lbz2 -lIlmImf -lImath -lHalf -lIex -lz -lrsvg-2 -lgdk_pixbuf-2.0 -lm -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -lxml2 -lgvc -lgraph -lcdt -lz -lm -lgomp -lpthread 
NAME          ImageMagick
PCFLAGS       -fopenmp
PREFIX        /usr/local
QuantumDepth  16
RELEASE_DATE  2010-11-10
VERSION       6.6.5
WEBSITE       http://www.imagemagick.org
New (not working):

Code: Select all

Path: /usr/local/lib/ImageMagick-6.6.4/config/configure.xml

Name          Value
-------------------------------------------------------------------------------
CC            gcc -std=gnu99 -std=gnu99
CFLAGS        -fopenmp -g -O2 -Wall -pthread
CONFIGURE     ./configure  'LDFLAGS=-L/usr/local/lib -R/usr/local/lib' '--with-quantum-depth=8' '--with-fontconfig=yes' '--with-freetype'
COPYRIGHT     Copyright (C) 1999-2010 ImageMagick Studio LLC
CPPFLAGS      -I/usr/local/include/ImageMagick
CXX           g++
CXXFLAGS      -g -O2 -pthread
DEFS          -DHAVE_CONFIG_H
DELEGATES     fontconfig freetype jpeg jng png x11 xml zlib
DISTCHECK_CONFIG_FLAGS 'LDFLAGS=-L/usr/local/lib -R/usr/local/lib' --disable-deprecated --with-umem=no --with-autotrace=no --with-gslib=no --with-fontpath= --with-perl=no
EXEC-PREFIX   /usr/local
FEATURES      OpenMP 
HOST          x86_64-unknown-linux-gnu
LDFLAGS       -L/usr/local/lib -L/usr/local/lib -R/usr/local/lib
LIB_VERSION   0x664
LIB_VERSION_NUMBER 6,6,4,10
LIBS          -lMagickCore -lfreetype -ljpeg -lpng -L/usr/local/lib -lfontconfig -lX11 -lxml2 -lz -lm -lgomp -lpthread -lltdl
NAME          ImageMagick
PCFLAGS       -fopenmp
PREFIX        /usr/local
QuantumDepth  8
RELEASE_DATE  2011-01-03
VERSION       6.6.4
WEBSITE       http://www.imagemagick.org

Re: Problem with "convert -list font" not finding attributes

Posted: 2011-01-03T13:46:49-07:00
by fmw42
make sure you move type.xml to the correct location in your system as specified in the notes in the script or search your system to find where it needs to be placed within the IM installed files. You may have multiple copies and the current version is not in the correct location.

try

find /usr | grep "type.xml"

to see where it needs to go

Re: Problem with "convert -list font" not finding attributes

Posted: 2011-01-03T14:51:52-07:00
by synexis
Hi fmw42,

Thank you, but that doesn't appear to be the issue.

I have type.xml located in "/usr/local/lib/ImageMagick-6.6.4/config/".
My installed fonts are referenced in another XML file within that same directory which is included by type.xml.
It's the same setup I have on my other server, which does not have this issue.
IM is parsing the file, just not finding the extra attributes on its own.

Re: Problem with "convert -list font" not finding attributes

Posted: 2011-01-03T15:53:32-07:00
by fmw42
Anthony will probably have to help answer this as he is the author of the perl script you are using.

Re: Problem with "convert -list font" not finding attributes

Posted: 2011-01-03T16:29:28-07:00
by synexis
Solved!!! :D

Thank you fmw42. Your suggestion led me to check the output of "convert -list type" a bit more carefully.

I noticed that on my old system, the fonts with the correct attributes were listed under "Path: System Fonts", while the ones with missing attributes on the new installation were listed under "Path: imagick_fonts.xml" (the xml file output by imagick_type_gen). It appears that on my old installation, for whatever reason, the imagick_type_gen xml file was not even being used.

My solution then, was to not use imagick_type_gen, but rather to install the fonts as system fonts. I'm sure there are a dozen ways to do this, but I moved my fonts (which were .otf) to /usr/share/fonts/opentype/ and then ran "fc-cache -vf", whilst removing the include reference to the xml file generated by imagick_type_gen.