This example shows how to display true type fonts(TTF) in php gd.
This example shows how to display true type fonts(TTF) in php gd.<?php
define(
"WIDTH", 300);define(
"HEIGHT", 100);define(
"F_SIZE", 40);define(
"F_ANGLE", 0);define(
"F_FONT", "C:/WINNT/Fonts/arial.ttf");imagerectangle(
$img, 0,0,WIDTH-1,HEIGHT-1, $black);imageTTFtext(
$img, F_SIZE, F_ANGLE, $start_x, $start_y, $black, F_FONT, $text);header(
"Content-Type: image/png");imagepng(
$img);?>
After running the program you will get the following output