It is possible to add font family (Arial, Comic MS Sense, etc) and make image as an anchor tag while creating text on image.

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

$string = "Text on image";

$font  = 5;
$width  = imagefontwidth($font) * strlen($string);
$height = imagefontheight($font);

$image = imagecreatetruecolor ($width,$height);
$white = imagecolorallocate ($image,255,255,255);
$black = imagecolorallocate ($image,1,143,208);

imagefill($image,0,0,$white);
imagestring ($image,$font,0,0,$string,$black);
imagepng($image);
imagedestroy($image);
?>

There's imageloadfont and imagepsloadfont, it's not as simple as providing the font name.

The anchor should be added in the HTML where you've also added this file in an img tag.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.