helraizer Posted October 28, 2007 Share Posted October 28, 2007 Hi all, My Chatbox I have been working on a dynamic image in GD2 which acts as a chatbox in a forum signature. It all seems to be working pretty well, but I have come across a bug (of sorts): if the user were to enter characters such as '¬_¬' the result in the image is shown as 'Ž_Ž'. Is there any way that, using PHP, I can change this so that is actually understands the characters and would print '¬_¬'.? Hope that makes sense. Sam Quote Link to comment Share on other sites More sharing options...
Barand Posted October 28, 2007 Share Posted October 28, 2007 If I use imagestring() I get the same results as you but if I use a truetype font (arial) it works <?php $font = 'c:/windows/fonts/arial.ttf'; $im = imagecreate (30,20) ; $bg = imagecolorallocate($im,0xFF,0xFF,0xFF); $tc = imagecolorallocate($im,0x00,0x00,0x00); imagettftext($im,9,0,5,15,$tc,$font,'¬_¬'); imagepng($im); imagedestroy($im); ?> Quote Link to comment Share on other sites More sharing options...
helraizer Posted October 29, 2007 Author Share Posted October 29, 2007 The way my Chatbox works in this instance is that when the user submits the data their username, the color of text and the message are all sent to a .line file. Rather than the text just being put in there and then when the dynamic image is produced. So if I use imagettftext it doesn't work; none of the messages show up on the image. (if you need code to help you understand, just holler and I'll paste) Any ideas? Sam Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.