Jump to content

PHP image/font questions


bachx

Recommended Posts

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);

?>

 

Link to comment
https://forums.phpfreaks.com/topic/83218-php-imagefont-questions/
Share on other sites

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.