Should bad fonts give no error but still generate an image?
I grabbed these two TTF's:
http://www.getfreefonts.info/free_font.almontesnow.html
http://www.getfreefonts.info/free_font.altea.html
Following Anthony's scripts, I tried
convert -background lightblue -fill blue -font almosnow.ttf -pointsize 72 label:Samantha almosnow-pointsize.png
and
convert -background lightblue -fill blue -font altea.ttf -pointsize 72 label:Samantha altea-pointsize.png
The first worked well but the second gave a 776x1 "one-dimensional" result. What the foo? Is there a detectable error that should be reported? (I'm presuming that this is a font bug and not an IM bug.)
When -size was stipulated, both worked properly.
convert -background lightblue -fill blue -font almosnow.ttf -size 360x100 -gravity center label:Samantha almosnow-size.png
convert -background lightblue -fill blue -font altea.ttf -size 360x100 -gravity center label:Samantha altea-size.png
Rick
Bad fonts, no error?
Re: Bad fonts, no error?
The font is returning bogus font metrics which prevents the label coder from computing a proper bounding box. Add -debug annotate to your command line and it reports the font metrics for the font for your inspection.
Re: Bad fonts, no error?
And is there a way that IM can glean something so obviously bogus? If so, an error message could be given.magick wrote:The font is returning bogus font metrics which prevents the label coder from computing a proper bounding box.
Not for my inspection, but maybe for you and your brother wizards! Here it is:Add -debug annotate to your command line and it reports the font metrics for the font for your inspection.
All that catches my untrained eye is "height: 0" which just seems wrong. Are there certain obvious things that IM can catch?2008-12-28T03:44:38+00:00 0:01 0.344u 6.4.8 Annotate convert[3152]: annotate.c/RenderFreetype/1451/Annotate
Font f:/windows/fonts/altea.ttf; font-encoding none; text-encoding none; pointsize 72
2008-12-28T03:44:38+00:00 0:01 0.344u 6.4.8 Annotate convert[3152]: annotate.c/G
etTypeMetrics/1001/Annotate
Metrics: text: Samantha; width: 773.563; height: 0; ascent: 0; descent: 0; max advance: 182; bounds: 1.4375,-1.15625 105.109,92.2969; origin: 773,0; pixels per em: 72,72; underline position: -2.34375; underline thickness: 0.78125
2008-12-28T03:44:38+00:00 0:01 0.344u 6.4.8 Annotate convert[3152]: annotate.c/RenderFreetype/1451/Annotate
Font f:/windows/fonts/altea.ttf; font-encoding none; text-encoding none; point
size 72
2008-12-28T03:44:38+00:00 0:01 0.359u 6.4.8 Annotate convert[3152]: annotate.c/GetTypeMetrics/1001/Annotate
Metrics: text: Samantha; width: 773.563; height: 0; ascent: 0; descent: 0; max
advance: 182; bounds: 1.4375,-1.15625 105.109,92.2969; origin: 773,0; pixels per em: 72,72; underline position: -2.34375; underline thickness: 0.78125
2008-12-28T03:44:38+00:00 0:01 0.359u 6.4.8 Annotate convert[3152]: annotate.c/R
enderFreetype/1451/Annotate
Font f:/windows/fonts/altea.ttf; font-encoding none; text-encoding none; pointsize 72
Rick