Font rendered not properly

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
richo

Font rendered not properly

Post 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 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.
richo

Re: Font rendered not properly

Post 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!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Font rendered not properly

Post by fmw42 »

post your IM command
richo

Re: Font rendered not properly

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Font rendered not properly

Post 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.)
Last edited by snibgo on 2010-05-30T08:23:15-07:00, edited 1 time in total.
snibgo's IM pages: im.snibgo.com
richo

Re: Font rendered not properly

Post by richo »

Is something like this possible with mogrify?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Font rendered not properly

Post by snibgo »

In my example, the -resize might mess up the original image. It could be done in a single "convert" command.
snibgo's IM pages: im.snibgo.com
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Font rendered not properly

Post 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
Image

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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
richo

Re: Font rendered not properly

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Font rendered not properly

Post 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.
richo

Re: Font rendered not properly

Post 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.
Post Reply