Page 1 of 1
Font rendering differs
Posted: 2008-05-13T02:17:15-07:00
by mattias
I have two machines running the same version of ImageMagick (6.4.1). Development on OS X and production on a FreeBSD.
If I render the same TTF font I get this results:
OS X
FreeBSD
What can cause the FreeBSD one to get so thin and strange? I installed the font with fontconfig and it looks ok if I list the fonts with convert -list font
Any ideas?
/mattias
Re: Font rendering differs
Posted: 2008-05-13T17:17:13-07:00
by fmw42
I suspect your fonts are not identical or your Ghostscript and Freetype are not the same on your two systms. But this is not my area of expertise
Re: Font rendering differs
Posted: 2008-05-13T23:36:59-07:00
by mattias
It's the same ttf font. And I use FreeType for rendering on FreeBSD. Would ghostscript be a better choise?
Re: Font rendering differs
Posted: 2008-05-15T00:54:16-07:00
by mattias
Is assume that FreeType is used to render the font when the font is a true type font.
Re: Font rendering differs
Posted: 2008-06-03T19:38:14-07:00
by anthony
Freetype has caused changes during system updates.
Basically I see IM examples involving drawing text all suddenly
render slightly differently after such an upgrade.
As such freetype differences could cause your problem.
Anothe rposibility is that one of the above examples is using the 'default' font rather than the font requested. This is casue by IM not finding the TTF font file. In some versions of IM the convert command did not output a warning about the requested font not being found so this problem often went unnoticed.
Check that the font really looks different to the same command without a -font setting.
Re: Font rendering differs
Posted: 2008-06-03T23:55:45-07:00
by mattias
I think I have tried everything - also different fonts and as soon as its a ttf font in sizes under around 16 pt it starts to differ. What I do now instead is render the font in double resolution then scale it down to 50%. This gives a ok result.
Re: Font rendering differs
Posted: 2008-06-04T00:02:09-07:00
by anthony
That is probbaly where the major change in freetype was ment to fix. Remember most text being typed to displays are at very low densitys, and thus dot size becomes very important to how good a font rendering engine works. At larger scale this isn't so critical.
however rather than a larger pointsize, try using a larger density, and the use -resample to resize the font, you will probably get much closer to the correct result for that specific point size. The final density of course should match the output device you are using for your image.
Re: Font rendering differs
Posted: 2008-06-04T00:13:33-07:00
by mattias
I did double the density (144x144), same pointsize and then scale to 0.5. I'll try resamle to 72 and see if it does the trick better.
Thanks
Re: Font rendering differs
Posted: 2008-06-04T00:48:05-07:00
by mattias
Resample did it much better. Starts to look really good.
Thanks again