Error code wrong for failure to find font

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
ridera

Error code wrong for failure to find font

Post by ridera »

convert -debug exception -size 320x100 xc:lightblue -font Times -pointsize 72 -fill blue -draw 'text 25,65 Anthony' /foo/fancy_title.png

error report: "unable to read font `Times'"

Error code is "0"

Image is written OK; but, just contains the lightblue background, no text.
ridera

Post by ridera »

This bug makes it difficult to use exceptions error catching.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Failure to find a font is a warning not an error. A warning means something unexpected happened but the process can continue. An error means something unexpected happened and the process cannot continue. The only solution would be to reclassify a failure to find a font as an error which would subsequently return an error status when the command line utilities are run.
ridera

Post by ridera »

Seems like I read somewhere that if a font cannot be found, a defaut one will be used. But, this doesn't seem to be the case.

I had a problem where IM could not find any fonts; the path was wrong on my shared host.

I'd suggest:
If can't find the fonts directory; that's an error.
If can't find a specified font; then post a warning and subsitute a default font.

Thanks, Al.......
Post Reply