hvdboorn Posted March 17, 2009 Share Posted March 17, 2009 Hi, I used the function imagecreatefrompng() to edit a png image. On the image should come a amount of money like €30, but the euro sign appears with the function imagestring() as a questionmark. I executed the function ini_set("default_charset","iso-8859-1"); before the text is outputted onto the image, but this doesn't work. I've tried everything like standard charset ini_set("default_charset",""); and all the iso charsets until 15. I also tried to use utf8 without any success. I also tried to add the eurosign through hex notation, but then I get a literal notation on the image. example: amount: €98 where it should be €98. What can I do? Link to comment https://forums.phpfreaks.com/topic/149856-problem-with-output-image-with-eurosign/ Share on other sites More sharing options...
benphelps Posted March 17, 2009 Share Posted March 17, 2009 You could use a TrueType or FreeType font that has the character in it. The front that it uses by default probably doesn't have the euro character in it, so it shows it as a "?". Here is what you should read on: http://www.php.net/manual/en/function.imagettftext.php http://www.php.net/manual/en/function.imagefttext.php Link to comment https://forums.phpfreaks.com/topic/149856-problem-with-output-image-with-eurosign/#findComment-787010 Share on other sites More sharing options...
hvdboorn Posted March 17, 2009 Author Share Posted March 17, 2009 thanks for your reply, I used this: imagettftext($img,15,0,57,14,$color,"C:/Windows/Fonts/Verdana.ttf","€".$goal); Now I don't get a questionmark but a rectangle! How can I solve this? Link to comment https://forums.phpfreaks.com/topic/149856-problem-with-output-image-with-eurosign/#findComment-787025 Share on other sites More sharing options...
benphelps Posted March 17, 2009 Share Posted March 17, 2009 try this imagettftext($img, 15, 0, 57, 14, $color, "C:/Windows/Fonts/Verdana.ttf", "" . chr(128).$goal . ""); Link to comment https://forums.phpfreaks.com/topic/149856-problem-with-output-image-with-eurosign/#findComment-787044 Share on other sites More sharing options...
hvdboorn Posted March 17, 2009 Author Share Posted March 17, 2009 I tried it, it still shows a rectangle Link to comment https://forums.phpfreaks.com/topic/149856-problem-with-output-image-with-eurosign/#findComment-787062 Share on other sites More sharing options...
POG1 Posted March 17, 2009 Share Posted March 17, 2009 Can't you use a font on the server.. Not everyone will have something in "C:/Winnows/Fonts/Verdana.ttf" i know i don't Link to comment https://forums.phpfreaks.com/topic/149856-problem-with-output-image-with-eurosign/#findComment-787067 Share on other sites More sharing options...
benphelps Posted March 17, 2009 Share Posted March 17, 2009 It doesn't ask you for a font, its server side only. If he has the font, than more power to him. As far as it still showing a blank character, I have no idea. Hopefully someone here knows. Link to comment https://forums.phpfreaks.com/topic/149856-problem-with-output-image-with-eurosign/#findComment-787074 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.