List:Eventum General Discussion« Previous MessageNext Message »
From:Joao Prado Maia Date:August 5 2004 3:22pm
Subject:RE: Incorrect encoding for national characters in graphs?
View as plain text  
Joaquim,

> > There seems to be an encoding issue when the ad-hoc graphs
> > are created.
> > Attached is an example (sorry about the BMP, I'm sitting on
> > someone else's
> > machine). The last row in the legend SHOULD say
> "Önskemål". The "å"
> > character is not properly encoded. Whatäs weird is that other
> > Swedish-language characters are encoded properly (ä, Ö, etc).
> >
>
> Yes, I saw that before. However, AFAIK the limitation here is inside
> the GD module, and not something that Eventum can work around.
>
> --Joao
>

Let me actually correct myself here. AFAIK the imagestring() function
is limited to only ASCII text, but imagettftext() should be able to
handle unicode text.

From http://us3.php.net/manual/en/function.imagettftext.php:

  "text is the text string which may include UTF-8 character sequences
(of the form: {) to access characters in a font beyond the first
255."

There's a pretty obscure feature in Eventum that will dynamically use
imagettftext() instead of imagestring() if the verdana.ttf file is
found inside the TTF_DIR directory.

From /path-to-eventum/include/jpgraph/jpgraph_dir.php:

  // Directory for TTF fonts. Must end with '/'
  DEFINE("TTF_DIR", APP_JPGRAPH_PATH . "ttf/");

So you basically need to create a "ttf" sub-directory under
/path-to-eventum/include/jpgraph/ and copy your verdana.ttf file in
there. Eventum will pick it up and start using it to display the
graphs, which should display Swedish characters just fine.

Please let me know if that works for you.

--Joao

Thread
Incorrect encoding for national characters in graphs?Joaquim Homrighausen4 Aug
  • RE: Incorrect encoding for national characters in graphs?Joao Prado Maia5 Aug
    • RE: Incorrect encoding for national characters in graphs?Joao Prado Maia5 Aug