Search code examples
phpimagemagickgdphpthumb

ImageTTFtext displays html-values for special characters


I've looked everywhere, but I can't figure out why I am facing this problem.

I am using phpThumb to do add some text (watermark) on some photos. The problem is that I need to use the special characters from Norway (æøå). These don't play so nice with ImageTTFtext.

enter image description here

The picture above contains the code for æ and should (according to the documentation) be correct. I've also tried some functions I found here on stack, but everything returns the same. Why does it print the code and not the actual character I am trying to display?

Is this due to old version of some software or something?

Versions:

PHP 5.3.2
ImageMagick 6.5.7
GD: 2.0

EDIT: Just to make it clear, I am passing the text the "correct" way according to the docs. Passing utf_encode('€') as the argument SHOULD WORK.


Solution

  • Answering this so anyone facing the same problem as me can find a solution.

    It turns out the "built in" font from GD did not support my special characters. Upload your own fonts and use them in the function, it should work.