Jump to content

(non-)Antialiasing problems with ImageTTFText()


StrikerNL

Recommended Posts

I would like to use ImageTTFText to put text on an image with a .ttf file, but the font is not being displayed properly.

This is my code:
[code]<?php

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

$im = imagecreatetruecolor(400, 60);

$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 1, 0, 0);
imagefilledrectangle($im, 0, 0, 399, 59, $white);

$font = 'lib/fonts/verdana.ttf';

imagettftext($im, 10, 0, 10, 20, -$black, $font, 'This is non antialiased, looks messed up');
imagettftext($im, 10, 0, 10, 40, $black, $font, 'This is antialiased, I don\'t want this');

imagepng($im);
imagedestroy($im);

?>[/code]

This is the output:
http://ddcrew.be/test.php

To explain what I want:
http://ddcrew.be/problem.png

I've already recompiled freetype with bytecode interpreter enabled, then GD and PHP, no effect.

Does anyone have any ideas?

Archived

This topic is now archived and is closed to further replies.

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