Home Tutorial Php Phpgd PHP GD font size

 
 

PHP GD font size
Posted on: November 7, 2009 at 12:00 AM
This example shows how to display font in php gd.

<?php

header ("Content-type: image/png");

$handle = ImageCreate (130, 50) or die ("Cannot Create image");

$bg_color = ImageColorAllocate ($handle, 255, 0, 0);

$txt_color = ImageColorAllocate ($handle, 0, 0, 0);

ImageTTFText ($handle, 20, 15, 30, 40, $txt_color, "C:/WINNT/Fonts/arial.ttf", "Rose");

ImagePng ($handle);

?>

After running the program you will get the following output

Related Tags for PHP GD font size:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.