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
Font rendering differs
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Font rendering differs
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
It's the same ttf font. And I use FreeType for rendering on FreeBSD. Would ghostscript be a better choise?
Re: Font rendering differs
Is assume that FreeType is used to render the font when the font is a true type font.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Font rendering differs
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.
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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Font rendering differs
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.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Font rendering differs
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.
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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Font rendering differs
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
Thanks
Re: Font rendering differs
Resample did it much better. Starts to look really good.
Thanks again
Thanks again