Menu

Greek Letters in Y Axis title

Scott Pon
2019-11-06
2019-11-06
  • Scott Pon

    Scott Pon - 2019-11-06

    I am trying to put a greek Omega into the Y Axis Title. I'm following the PHPlot reference manual and its not working for me. Here's what I'm doing:
    I have a MySQL server. one of the fields is "YAxisTitle". so I use PHP to connect to the mySQL server, I find the record I want (out of 100ish). and pull the information from the fields, one of them is YAxisTitle. I use the Plot->SetYTitle ( mySQL_Result($datasource, 0, "YAxisTitle")

    but I can't get the Greek Letter Omega to come out. I used the examples in the manaul for the Euro sign. HTML Unicode Euro is &#8364 and UTF-8 is \xe2\x82\xac. but instead of the symbol, I get that text.

    Anyone got any suggestions?

     
  • lbayuk

    lbayuk - 2019-11-06
    1. Make sure you are using a TrueType font, e.g. with SetDefaultTTFont() and/or SetUseTTF(True). The built-in (non TrueType) GD fonts do not support what you are trying to do.

    2. Test with a hard-coded string, e.g. SetXTitle("Test Omega Ω")

    3. If you did (1), (2) works, but your code still does not work, you need to see exactly what MySQL is returning for that field. It should work with either the XML decimal numeric entity, or with the UTF-8 encoding of the character.

     
  • Scott Pon

    Scott Pon - 2019-11-06

    That worked! I had to set up a font, but it does work now. Thanks.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.