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
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
You see, the 'y' is beyond the background. why it happened? does -pointsize control the max height of the font?
Font size question
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Font size question
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
Two solutions. Use a better font. Or annotate the text on to a larger canvas, so the font has space to draw.
http://imagemagick.org/Usage/text/#overflow
IM does endeavor to figure out and resize labels to handle such ill-behaved fonts, but it isn't always successful.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.
Two solutions. Use a better font. Or annotate the text on to a larger canvas, so the font has space to draw.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Font size question
I readed that article, but I can't image it will happened with this Microsoft's font.
Thanks anthony.
Thanks anthony.