class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
It comes from the fact that the fonts provided with GD are not utf-8, so the characters you want are missing. To use GD with Cyrillic languages, or Farsi, etc... you need to use TTF fonts.
I guess you could recompile GD with a ISO-8859-1 or UTF-8 font, but that is a bit overkill.
You could also load an alternative TTF font using imagettftext or imageloadfont, but the class doesn't support using non-core fonts yet... I don't have much time right now, but I could let myself persuaded to implement it ;)
It also looks like you'd better have the last version of GD (2.0.32+) which fixes some issues with UTF-8 detection in TTF files.Reply
well, it seems that my GD config is not good : I think i need freetype enabled GD to get the function imagettftext.
config on my provider (works) :
GD Support enabled
GD Version 2.0 or higher
FreeType Support enabled
FreeType Linkage with freetype
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
my config :
GD Support enabled
GD Version bundled (2.0.28 compatible)
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
i will tell you later if it's the good reasonReply
I think the neatest solution would be for me to implement a way to load fonts in the class so that you can use different encodings. I will happen in the near future.
In the mean time, you will have to hack the class to use imagettftextReply
The images created with upload.class are full of awful typos instead of accented letters
I searched in your FAQ, forum, but nothing about that
I used utf-8 encoded php pages to generate pictures
Could you help me ?
(you can reply in french i you prefer)
It comes from the fact that the fonts provided with GD are not utf-8, so the characters you want are missing. To use GD with Cyrillic languages, or Farsi, etc... you need to use TTF fonts.
I guess you could recompile GD with a ISO-8859-1 or UTF-8 font, but that is a bit overkill.
You could also load an alternative TTF font using imagettftext or imageloadfont, but the class doesn't support using non-core fonts yet... I don't have much time right now, but I could let myself persuaded to implement it ;)
It also looks like you'd better have the last version of GD (2.0.32+) which fixes some issues with UTF-8 detection in TTF files.
config on my provider (works) :
my config :
i will tell you later if it's the good reason
I think the neatest solution would be for me to implement a way to load fonts in the class so that you can use different encodings. I will happen in the near future.
In the mean time, you will have to hack the class to use imagettftext