Simple Text Label Examples Fails
-
- Posts: 31
- Joined: 2004-10-28T11:18:28-07:00
- Location: Virginia, USA
Simple Text Label Examples Fails
I am following the first official ImageMagick text example posted http://www.cit.gu.edu.au/~anthony/graph ... ick6/text/ called Label - Simple Text Label, and using the current version of ImageMagick, but the example fails. Can someone please show me a successful example of drawing text to a raster image?
$ convert -version
Version: ImageMagick 6.2.8 07/07/06 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC
$ convert -background lightblue -fill blue -font Candice -pointsize 72 label:Anthony label.gif
sh: line 1: gs: command not found
sh: line 1: gs: command not found
convert: unable to read font `Candice'.
convert: no decode delegate for this image format `/var/tmp/magick-VV0hazky'.
convert: Postscript delegate failed `/var/tmp/magick-VV0hazky'.
convert: missing an image filename `label.gif'.
$ convert -version
Version: ImageMagick 6.2.8 07/07/06 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC
$ convert -background lightblue -fill blue -font Candice -pointsize 72 label:Anthony label.gif
sh: line 1: gs: command not found
sh: line 1: gs: command not found
convert: unable to read font `Candice'.
convert: no decode delegate for this image format `/var/tmp/magick-VV0hazky'.
convert: Postscript delegate failed `/var/tmp/magick-VV0hazky'.
convert: missing an image filename `label.gif'.
To annotate an image you need to build ImageMagick with the Freetype delegate library without it ImageMagick will use Ghostscript to render fonts. Type
- identify -list format
- TTF* TTF r-- TrueType font (Freetype 2.1.10)
-
- Posts: 31
- Joined: 2004-10-28T11:18:28-07:00
- Location: Virginia, USA
Running the identify -list format command as you suggest shows that my ImageMagick can access several font collections. But when following the ImageMagick text example, I still get the same error I originally posted, and I remain unable to use ImageMagick to draw text in a raster image. Can someone please demonstrate the syntax for drawing text?
identify -list format | grep font
OTF* TTF r-- Open Type font (Freetype 2.2.1)
PFA* TTF r-- Postscript Type 1 font (ASCII) (Freetype 2.2.1)
PFB* TTF r-- Postscript Type 1 font (binary) (Freetype 2.2.1)
TTC* TTF r-- TrueType font collection (Freetype 2.2.1)
TTF* TTF r-- TrueType font (Freetype 2.2.1)
identify -list format | grep font
OTF* TTF r-- Open Type font (Freetype 2.2.1)
PFA* TTF r-- Postscript Type 1 font (ASCII) (Freetype 2.2.1)
PFB* TTF r-- Postscript Type 1 font (binary) (Freetype 2.2.1)
TTC* TTF r-- TrueType font collection (Freetype 2.2.1)
TTF* TTF r-- TrueType font (Freetype 2.2.1)
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
-
- Posts: 31
- Joined: 2004-10-28T11:18:28-07:00
- Location: Virginia, USA
I tried using -font courier-new and -font times-new-roman, but that continues to yield the same error message I originally reported on 11 July 2006. So, I still do not have any way to draw text with ImageMagick. Can someone demonstrate a convert command line that successfully draws text?
$ convert -background lightblue -fill blue -font courier-new -pointsize 72 label:Anthony label.gif
sh: line 1: gs: command not found
sh: line 1: gs: command not found
convert: unable to read font `courier-new'.
convert: no decode delegate for this image format `/var/tmp/magick-evm8uUyR'.
convert: Postscript delegate failed `/var/tmp/magick-evm8uUyR'.
convert: missing an image filename `label.gif'.
$ convert -background lightblue -fill blue -font times-new-roman -pointsize 72 label:Anthony label.gif
sh: line 1: gs: command not found
sh: line 1: gs: command not found
convert: unable to read font `times-new-roman'.
convert: no decode delegate for this image format `/var/tmp/magick-lLBxwQ9t'.
convert: Postscript delegate failed `/var/tmp/magick-lLBxwQ9t'.
convert: missing an image filename `label.gif'.
$ convert -background lightblue -fill blue -font courier-new -pointsize 72 label:Anthony label.gif
sh: line 1: gs: command not found
sh: line 1: gs: command not found
convert: unable to read font `courier-new'.
convert: no decode delegate for this image format `/var/tmp/magick-evm8uUyR'.
convert: Postscript delegate failed `/var/tmp/magick-evm8uUyR'.
convert: missing an image filename `label.gif'.
$ convert -background lightblue -fill blue -font times-new-roman -pointsize 72 label:Anthony label.gif
sh: line 1: gs: command not found
sh: line 1: gs: command not found
convert: unable to read font `times-new-roman'.
convert: no decode delegate for this image format `/var/tmp/magick-lLBxwQ9t'.
convert: Postscript delegate failed `/var/tmp/magick-lLBxwQ9t'.
convert: missing an image filename `label.gif'.
-
- Posts: 31
- Joined: 2004-10-28T11:18:28-07:00
- Location: Virginia, USA
ImageMagick identify -list format | grep font finds support for five Freetype 2.2.1 fonts, so convert should also be finding Freetype support. How do I get convert to use the Freetype fonts that identify finds?
identify -list format | grep font
OTF* TTF r-- Open Type font (Freetype 2.2.1)
PFA* TTF r-- Postscript Type 1 font (ASCII) (Freetype 2.2.1)
PFB* TTF r-- Postscript Type 1 font (binary) (Freetype 2.2.1)
TTC* TTF r-- TrueType font collection (Freetype 2.2.1)
TTF* TTF r-- TrueType font (Freetype 2.2.1)
identify -list format | grep font
OTF* TTF r-- Open Type font (Freetype 2.2.1)
PFA* TTF r-- Postscript Type 1 font (ASCII) (Freetype 2.2.1)
PFB* TTF r-- Postscript Type 1 font (binary) (Freetype 2.2.1)
TTC* TTF r-- TrueType font collection (Freetype 2.2.1)
TTF* TTF r-- TrueType font (Freetype 2.2.1)
-
- Posts: 31
- Joined: 2004-10-28T11:18:28-07:00
- Location: Virginia, USA
I actually posted the version of convert I am using in my initial posting on 11 July 2006. Here it is again.
convert -version
Version: ImageMagick 6.2.8 07/07/06 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC
Can you please post the exact convert command line that is successful for you?
convert -version
Version: ImageMagick 6.2.8 07/07/06 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC
Can you please post the exact convert command line that is successful for you?
Try
- convert -verbose -background lightblue -fill blue -font helvetica -pointsize 72 label:Anthony label.gif
-
- Posts: 31
- Joined: 2004-10-28T11:18:28-07:00
- Location: Virginia, USA
That does not work for me
It is possible that to draw text under Mac OS X 10.4 requires different syntax?
Greg
convert -version
Version: ImageMagick 6.2.8 07/07/06 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC
identify -list format | grep font
OTF* TTF r-- Open Type font (Freetype 2.2.1)
PFA* TTF r-- Postscript Type 1 font (ASCII) (Freetype 2.2.1)
PFB* TTF r-- Postscript Type 1 font (binary) (Freetype 2.2.1)
TTC* TTF r-- TrueType font collection (Freetype 2.2.1)
TTF* TTF r-- TrueType font (Freetype 2.2.1)
convert -verbose -background lightblue -fill blue -font helvetica -pointsize 72 label:Anthony label.gif
sh: line 1: gs: command not found
sh: line 1: gs: command not found
convert: unable to read font `helvetica'.
convert: no decode delegate for this image format `/var/tmp/magick-vOk9C76c'.
convert: Postscript delegate failed `/var/tmp/magick-vOk9C76c'.
convert: missing an image filename `label.gif'.
It is possible that to draw text under Mac OS X 10.4 requires different syntax?
Greg
convert -version
Version: ImageMagick 6.2.8 07/07/06 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLC
identify -list format | grep font
OTF* TTF r-- Open Type font (Freetype 2.2.1)
PFA* TTF r-- Postscript Type 1 font (ASCII) (Freetype 2.2.1)
PFB* TTF r-- Postscript Type 1 font (binary) (Freetype 2.2.1)
TTC* TTF r-- TrueType font collection (Freetype 2.2.1)
TTF* TTF r-- TrueType font (Freetype 2.2.1)
convert -verbose -background lightblue -fill blue -font helvetica -pointsize 72 label:Anthony label.gif
sh: line 1: gs: command not found
sh: line 1: gs: command not found
convert: unable to read font `helvetica'.
convert: no decode delegate for this image format `/var/tmp/magick-vOk9C76c'.
convert: Postscript delegate failed `/var/tmp/magick-vOk9C76c'.
convert: missing an image filename `label.gif'.
I just gave the example a try (I built the IM that Greg is using). Part of the problem is locating the fonts. None of the normal OS X font paths are searched (/System/Library/Fonts, /Library/Fonts, ~/Library/Fonts) so just the font name is not enough. I found that when it couldn't find the font, I get the gs error.
Another part of the problem seems to be reading certain font formats. I could get otf and Windows flat ttf and pfb (PS) fonts to work, but Mac style TT and PS fonts and dfonts give me a simple 'unable to read font' error, no gs mess.
So, something is up with my build of FreeType - I've only really ever used OTF and flat TT fonts with my FreeType build. I'll look into it. And the font search path thing also.
Another part of the problem seems to be reading certain font formats. I could get otf and Windows flat ttf and pfb (PS) fonts to work, but Mac style TT and PS fonts and dfonts give me a simple 'unable to read font' error, no gs mess.
So, something is up with my build of FreeType - I've only really ever used OTF and flat TT fonts with my FreeType build. I'll look into it. And the font search path thing also.
Another possible source of the problem - for Mac type font packages (suitcases, dfonts) where more than one font face or style can be in a single file (I think OTF fonts can also have more than one), how does one specify the style within the file? ie /Library/Fonts/Arial contains regular, bold, italic and bold-italic. All these multi-face font packages are where the errors are happening.
-
- Posts: 31
- Joined: 2004-10-28T11:18:28-07:00
- Location: Virginia, USA
Let's say I want to use the fixed width font Courier. Courier comes in 4 flavors, under Mac OS X.
Courier Regular
Courier Oblique
Courier Bold
Courier Bold Oblique
How do I tell ImageMagick which of these 4 flavors to use?
I would still like to see example syntax for using convert to draw text under Mac OS X. So far, everything we have tried has failed.
Courier Regular
Courier Oblique
Courier Bold
Courier Bold Oblique
How do I tell ImageMagick which of these 4 flavors to use?
I would still like to see example syntax for using convert to draw text under Mac OS X. So far, everything we have tried has failed.