Jawed Posted July 30, 2010 Share Posted July 30, 2010 Hi All, I am getting this problem for one of my site that i am developing . When I insert special characters string like thi's ~!@#$%^&*()_+| the code is unable to convert it into right image with all text on it when the chosen font in trajanpro.ttf, but when I change the font with Ariel it work's fine. If anyone want to check this problem then you can check at this link http://www.centralstationery.com/produc ... ate_id=231 Click the text on card and a pop up will open and then change the font to Ariel then the image on card will be converted into right text. The code is imageSaveAlpha($image, true); ImageAlphaBlending($image, false); $bgcolor = imagecolorallocate($image, 200, 200, 200); $transparentColor = imagecolorallocatealpha($image, 200, 200, 200, 127); imagefill($image, 0, 0, $transparentColor); // pick color for the text $fontcolor = imagecolorallocate($image, $red, $grn, $blu); // fill in the background with the background color imagefilledrectangle($image, 0, 0, $width, $height, $transparentColor); $x = 0; $y = $fontsize; imagettftext($image, $fontsize, 0, $bx, $by, $fontcolor, $font, $quote); $final_image=DIR_USER_EDITOR.$new_image; // output image to the browser imagepng($image, $final_image); // delete the image resource imagedestroy($image); Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/209319-imagettftext-not-working-with-trajanprottf/ Share on other sites More sharing options...
harristweed Posted July 30, 2010 Share Posted July 30, 2010 Are these characters available in the font? Can you display them in any other application? Quote Link to comment https://forums.phpfreaks.com/topic/209319-imagettftext-not-working-with-trajanprottf/#findComment-1092991 Share on other sites More sharing options...
Jawed Posted July 30, 2010 Author Share Posted July 30, 2010 Thanks for the reply but i did not get your point, If I change the font to Ariel or some other then it works fine. Quote Link to comment https://forums.phpfreaks.com/topic/209319-imagettftext-not-working-with-trajanprottf/#findComment-1092992 Share on other sites More sharing options...
harristweed Posted July 30, 2010 Share Posted July 30, 2010 My point is: can that font display those characters? The problem is the font not PHP Quote Link to comment https://forums.phpfreaks.com/topic/209319-imagettftext-not-working-with-trajanprottf/#findComment-1093011 Share on other sites More sharing options...
Jawed Posted July 30, 2010 Author Share Posted July 30, 2010 Again thanks for ur reply, But how to very this???? and @ is also not displayed by this font even hyphen (') also. Quote Link to comment https://forums.phpfreaks.com/topic/209319-imagettftext-not-working-with-trajanprottf/#findComment-1093016 Share on other sites More sharing options...
harristweed Posted July 31, 2010 Share Posted July 31, 2010 To verify, use the font in MsWord or other program, and try the characters. If that is the problem you can solve it easily. Buy the full version: http://www.fonts.com/FindFonts/detail.htm?pid=414225 Quote Link to comment https://forums.phpfreaks.com/topic/209319-imagettftext-not-working-with-trajanprottf/#findComment-1093446 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.