Jump to content

Loading truetype font


pvtpyro

Recommended Posts

Here's what I've got going so far. If you have gd library you can test it.
How would I go about loading true type fonts? I've gone through the tutorials here but they explain different types of font. when i simply try to change to tff it doesn't work.

I would deeply appreciate any help  :)

[code]<?php
header("Content-type: image/gif");
$image = imagecreate( 300, 150 );
imagecolorallocate($image,100, 149, 237);
$border = imagecolorallocate($image, 0, 0, 0);
$string = '(C) blah blah';
$white = imagecolorallocate($image, 255, 255, 255);
$black = imagecolorallocate($image, 0, 0, 0);
imagestring($image, $font, 10, 10, "Hello", $black);
$len = strlen($string);
for ($i=1; $i<=$len; $i++) {
  imagecharup($image, $font_size, 5, imagesy($image)-($i*imagefontwidth($font_size)), $string, $black);
  $string = substr($string,1);
}
imagegif($image);
imagedestroy($image);
?>
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.