Answer the question
In order to leave comments, you need to log in
Appearance of fonts when rendering text on a picture?
Hey Habr!
I am asking the question again. I hope at least someone knows the answer to this question.
In general, there is a script that makes a thumbnail of a picture and draws text with a description on it, like this:
The script does this with the help of the gd library. There are two servers that should generate captions on pictures identical in style (this is a photo host for one blog service).
One of the servers is virtual hosting, the second is VDS with Debian on board. The VDS is running apache2+php5+php5-gd to serve incoming images.
The problem is that the font is superimposed somehow ugly on VDS, and on a shared hosting, the same script does an excellent job.
For clarity of comparison, I will give examples of generating test text with English and Russian pangrams plus symbols.
Shared hosting:
VDS:
If you look closely, on VDS the font is thinner, spaced and poorly centered, and when you specify the size (eg 640x480), the "x" fits on the numbers.
All this generates the same script using the same font (Ubuntu Normal).
Question: how to make font rendering on VDS the same as on shared hosting? Maybe there are some configs that are responsible for the fonts in gd?
Tried to change configs /etc/fonts, they do not give any effect.
PHP version: hoster 5.2, VDS 5.3
GD version all 2.0
The FreeType version of VDS is 2.4.2, the hoster is lower (I don’t remember exactly, like 2.3).
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question