Font handling

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
spaced
Posts: 4
Joined: 2017-07-04T01:50:49-07:00
Authentication code: 1151

Font handling

Post by spaced »

I'm wondering if anyone here can shed any light on a problem I'm having.

Certain fonts behave differently when I use them in PS / Illustrator and ImageMagick

For example, RoseWood font: http://www.fontpalace.com/font-details/Rosewood/

In Photoshop (or other applications), all the letters are close together eg:

Image

But when I render it using IM, the 'W' has extra space between itself and the letters adjacent to it eg:

Image

It's not just the W that has problems - letters such as V or Y also have same issue.

Please can anyone tell me if there is any solution to this? Thank you in advance

-------------
I'm using PHP and ImageMagick 6.8.9-9 Q16 x86_64 on Ubuntu 16.04
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Font handling

Post by magick »

We're getting expected results with ImageMagick 6.9.9-10, the current release, and Freetype 2.7.1. There are four paths that can generate artifacts in font rendering: the font metrics, the interpretation of the font metrics with hinting, the release of ImageMagick, and the release of Freetype. In your case, we cannot decipher which of these paths causes less than optimal results for you.
spaced
Posts: 4
Joined: 2017-07-04T01:50:49-07:00
Authentication code: 1151

Re: Font handling

Post by spaced »

Thank you for your reply.

How would I go about investigating which of those 4 are causing the issue?

I tried checking which version of Freetype I have installed but couldn't find that information :/

If it helps, I just ran a test using the latest version of graphicsmagick and got the same issue as with IM - so i'm guessing it's not the IM version?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Font handling

Post by fmw42 »

I suggest you just upgrade ImageMagick and Freetype, then see if the problem exists. You could also download another version of your font from somewhere else to be sure it is not the font.

You have not provided your command, so we do not know what method you used to convert text to an image?

Font metrics on that font are not very good. I ran this command on IM 6.9.9.11 Q16 with Freetype 2.8_0 and got this result.

Code: Select all

convert -size x100 -background white -font /Library/Fonts/Rosewood.ttf label:"HOWARD" howard_69911.jpg
Image

With the same command on IM 6.8.9.9 Q16 Mac OSX, I get just a slightly different image.

Image
Post Reply