Problem with font rendering (looks too thin)

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
iGEL

Problem with font rendering (looks too thin)

Post by iGEL »

Hi!

I need to generate headline images for a client. On my Mac, everything works fine, but on the server (runs on old version of Debian), the font looks to thin.

This is, what I generated on my Mac:
Image

This is the result of the same command on Linux:
Image
The code to generate the image is:

Code: Select all

convert -size 350x120 -background 'rgba(0,0,0,0)' -font ScalaSan.ttf -gravity SouthWest -pointsize 20 -fill 'rgba(0,0,0,0.7)' caption:"This is the desired image." test.png
On the Mac, I've installed ImageMagick 6.6.2-9 via Macports. On the Debian server, it was installed via apt-get (Version is 6.3.7). I could reproduce the problem on my private Ubuntu server (6.5.7-8) and even compiled 6.6.5-9 from the source, but the result was always the the same. So it's not the version of ImageMagick, but might be a dependent library. The font is also broken, if I generate a non-transparent background.

Any ideas? Please help (as I'm already late with this project)!

Regards, iGEL
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problem with font rendering (looks too thin)

Post by fmw42 »

If the IM versions are not the same, or the fonts are not exactly the same even though you have the same font name, then that could cause a problem. I am not sure if you need to verify the same Ghostscript (probably not as it is for PDF and the like) or Freetype delegates. Someone more knowledgeable about fonts would have to answer.
User avatar
GreenKoopa
Posts: 457
Joined: 2010-11-04T17:24:08-07:00
Authentication code: 8675308

Re: Problem with font rendering (looks too thin)

Post by GreenKoopa »

Since you are in a hurry, I'll throw out ideas. Hopefully someone can help you with fonts in particular.

There was a recent post (ImageMagick Perform differently under different os) concerning inconsistencies of a different sort. Maybe some help there?

My first thought is to make the text too large then resize down. This sometimes helps in achieving consistency, but with the wrong resize filter could end up looking awful. Maybe a -stroke would help achieve different results? Removing the text and/or background transparency doesn't help at all?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Problem with font rendering (looks too thin)

Post by anthony »

The two systems have different delegate libraries (or versions of that library) that IM calls to render text to a raster image using the given font and other settings.

At first look I thought that maybe the second 'undesirable' image was bitmap, and your problem was in output format but the result does appear aliased so that does not seem to be the problem. Becides you also said you get the same result on a non-transparent background.

However as I do not have a copy of ScalaSan.ttf I can't actually try it on my system.
I did a search for it but the only site listing it also reports that it has removed it for "copyright reasons".
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
iGEL

Re: Problem with font rendering (looks too thin)

Post by iGEL »

Hi!

I found a solution. It was the combination of some kind of library on linux and the font, which was converted from another format. I've got the original TTF from the screendesigner and that font works fine.

Thank you for your time!

Regards, iGEL
Post Reply