Page 1 of 1
Font rendered not properly
Posted: 2010-05-26T00:18:11-07:00
by richo
Hello,
I use same font on web using gd2 lib and using mogrify localy. Rendering same text I get different output.
Please take a look at the image
In the screen shot upper text in picture is result of mogrify rendering below is result from gd2. If you look at "c" letter you will see that it is cut from button in image generated from mogrify and few more letters feels cutted a bit from bottom.
I am using following font
http://www.richard-vanek.eu/wp-content/ ... nt_ttf.zip
I would really apreciate if you can take a look. Not sure where is the problem.
Thank you very much.
Re: Font rendered not properly
Posted: 2010-05-27T11:32:51-07:00
by richo
Any idea how can i avoid this effect of cutting button of the text?
I may be doing something wrong, but no clue what.
Thanks in advance!
Re: Font rendered not properly
Posted: 2010-05-27T11:35:28-07:00
by fmw42
post your IM command
Re: Font rendered not properly
Posted: 2010-05-28T04:49:07-07:00
by richo
Thanks for reacting
I use
mogrify.exe -font annifont -pointsize 14 -fill black -annotate +25+70 "Serene landscape" empty.gif
This effect is happening only if font is less than 16 point, when larger it is rendered nicely.
Is there anything I can improve it so also with small font sizes the image is ok?
Thanks
Re: Font rendered not properly
Posted: 2010-05-28T06:13:27-07:00
by snibgo
See
http://www.imagemagick.org/Usage/text/ for many options.
For example, this gives a better "c":
Code: Select all
convert -size 800x100 xc:none -fill black -density 288 -font annifont.ttf -annotate 0 "Serene landscape" -resize 25%% -trim +repage serene.png
You could then composite serene.png over your image.
(EDIT: removed bad quote after convert.)
Re: Font rendered not properly
Posted: 2010-05-30T05:16:17-07:00
by richo
Is something like this possible with mogrify?
Re: Font rendered not properly
Posted: 2010-05-30T08:24:29-07:00
by snibgo
In my example, the -resize might mess up the original image. It could be done in a single "convert" command.
Re: Font rendered not properly
Posted: 2010-05-30T23:44:47-07:00
by anthony
On my linux system I see no clipping of the 'c'.
After installing the font and running my "imagick_type_gen" script appropriatally to add the font to my personal type.xml file...
I then ran teh command...
Code: Select all
convert -size 200x50 xc: -font annifont -pointsize 14 -fill black -gravity center -annotate +0+0 "Serene landscape" serene.png
No problem I can see.. prehaps it is the font engine that your windows machine is using.
Note mogrify is not particuarly nice or safe to use, as it can only modify existing images.
Re: Font rendered not properly
Posted: 2010-05-31T14:33:37-07:00
by richo
anthony,
thank you very much. This feels like bad news as I don't think I can change my font engine on Windows7.
Re: Font rendered not properly
Posted: 2010-05-31T15:20:46-07:00
by fmw42
I get the same result as Anthony on IM 6.6.2.1 Q16 Mac OSX Tiger.
What version of IM are you using? Perhaps if old, you might try upgrading.
Re: Font rendered not properly
Posted: 2010-05-31T23:36:52-07:00
by richo
I am using recent ImageMagick with 16bit calculations and in 64bit executable format on Win7 Pro 64bit.
I mentioned in my first post that gd2 library renders that text better. I just tried run it locally on the same system where I run ImageMagick and text is also rendered correctly. Does it means that gd2 lib is using different font engine?
I am using ImageTTFText() function of gd2 library to render the font.