french accented letters issue

See all posts Reply

french accented letters issue new!
by robin, 17 years, 11 months ago
i have some problem with french accented letters like éè? â...

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)Reply
Re: french accented letters issue new!
by colin, 17 years, 11 months ago
Salut ;)

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
Re: french accented letters issue new!
by robin, 17 years, 11 months ago
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
Re: french accented letters issue new!
by colin, 17 years, 11 months ago
Yes, you need Freetype enabled for imagettftext.

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
Re: french accented letters issue new!
by colin, 8 years, 2 months ago
UTF-8 support with TrueType fonts has been implemented, see this thread.Reply