Page 1 of 1

Font size question

Posted: 2008-06-26T20:21:10-07:00
by blackgun
hi,
I did this:
convert -size 400x70 xc:blue -fill red -font './impact.TTF' -pointsize 70 -gravity center -rotate 0 -annotate +0+0 'Text Cry/^$!' label2.png

Image

It is ok, the text is all in the background.

Then I did this:
convert -size 400x70 xc:blue -fill red -font './MSYH.TTF' -pointsize 70 -gravity center -rotate 0 -annotate +0+0 @utf8cn.txt label1.png
Image

You see, the 'y' is beyond the background. why it happened? does -pointsize control the max height of the font?

Re: Font size question

Posted: 2008-06-26T20:38:27-07:00
by anthony
What happened is that the font is badly behaved, and is drawing outside the bounds of the region is says it draws into.
http://imagemagick.org/Usage/text/#overflow
Remember this problem is NOT a bug in IM, but caused by the interaction of the the font library IM uses, and the settings within the font itself, usually on purpose by the font designer. IM just uses the results as they are programmed in the font, which does not always produce what the user intended. Caution is thus advised with unusual fonts.
IM does endeavor to figure out and resize labels to handle such ill-behaved fonts, but it isn't always successful.

Two solutions. Use a better font. Or annotate the text on to a larger canvas, so the font has space to draw.

Re: Font size question

Posted: 2008-06-26T22:54:39-07:00
by blackgun
I readed that article, but I can't image it will happened with this Microsoft's font. :(
Thanks anthony.