bachx Posted December 26, 2007 Share Posted December 26, 2007 I want to dynamically generate an image containing a text string that the user defines, I have a couple of questions though. - I want to set a font size for the text higher than 5 (Which is the maximum size imagestring() allows) - I want to change the font type - I want to align the text to the right. Any tips/help is appreciated. Thanks in advance. Here is the code I'm using to generate the image: <?php $chars = $_GET['title']; $width = strlen($chars)*10; $image = ImageCreate($width, 40); $bg_color = ImageColorAllocate($image, 174, 160, 133); $fnt_color = ImageColorAllocate($image, 255, 255, 255); imagestring($image, 5, 8, 5, $chars, $fnt_color); $image = imagerotate($image, 90, 0); imagePNG($image); imageDestroy($image); ?> Quote Link to comment https://forums.phpfreaks.com/topic/83218-php-imagefont-questions/ Share on other sites More sharing options...
Barand Posted December 26, 2007 Share Posted December 26, 2007 Use true type fonts and you can then set any size www.php.net/imagettftext When positioning the ttf text note that y is the baseline and not the top of the text as with imagestring Quote Link to comment https://forums.phpfreaks.com/topic/83218-php-imagefont-questions/#findComment-423352 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.