Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying ttf text with angle=90

Status
Not open for further replies.

gaudibri

Programmer
Dec 6, 2002
19
FR
Hey there,

I'm trying to display a string with an 90 angle using imagettftext. All is correct on my localhost but doesn't work in line : the string is going from bottom to top (correct) but the letters are not well-oriented. You can check it at
Can someone help me ?

Thank you
 
Without seeing your code, it's nearly impossible to advise you.

I can say that this code, modified from example code on the imagettftext() online manual page, produces readable text:

Code:
<?php
// Set the content-type
header("Content-type: image/png");

// Create the image
$im = imagecreate(40, 150);

// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);

// The text to draw
$text = 'Testing...';
// Replace path by your own font path
$font = 'arial.ttf';

// Add the text
imagettftext($im, 20, 90, 35, 150, $black, $font, $text);

// Using imagepng() results in clearer text compared with imagejpeg()
imagepng($im);
imagedestroy($im);
?>


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top