MyBB Community Forums

Full Version: GD Antialias - Pay $$$
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I need a code(function) that allows me to generate "My text" in Arial, font 10, anti alias. I pay $$$ using paypal.
Your gonna have to explain a lot more.
like I say Antialias("Hello world!","Arial",10), it will generate Hello world in Arial font 10, anti-aliased.
just attach some CSS?
<?php
header('content-type: image/png');
$im = imagecreatetruecolor(800,600);

// Important stuff
// Allocate a transparent background color
$bg = imagecolorallocatealpha($im,255,0,0,127);
// ..and a non-transparent text color
$text = imagecolorallocate($im,0,0,0);
// Turn on full alpha channel saving for PNG images
imagesavealpha($im,true);

// Fill with transparent and text with the other
imagefill($im,0,0,$bg);
imagettftext($im,40,0,50,50,$text,'C:\Windows\Fonts\arial.ttf','S58G');

imagepng($im);
?>

thats a direct file itself (say name.png)
credit: http://www.webmaster-talk.com/php-forum/...asing.html

how you use it is up to you, but like lyndon said, css. it'd be simpler and give you a better end result in my opinion. hence why i wont go any further then posting the image creation code itself
If you use imgttftext and the proper arial font, it should be anti-aliased anyways.