Jump to content

imagettftext not working with trajanpro.ttf


Jawed

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.