Jump to content

low font quality / GD


krystek

Recommended Posts

Hi. I have problem with GD and font quality. Background is my png image (with transparent).

Here is an example how does it looks like with black "test.png" image:

imagekk9.png

Is any way to set better font quality? Thanx!

 

<?
header("Content-type: image/png");
$text = $_GET['text'];
$im = imagecreatefrompng("test.png");
$color = imagecolorallocate($im, 255, 255, 255);
$font = "./verdana.ttf";
$font_size = 7.5;

$length_text = imagettfbbox($font_size, 0, $font, $text);
$dx_text = (imagesx($im)) - (abs($length_text[2]-$length_text[0]));

imageSaveAlpha($im, true);
ImageAlphaBlending($im, true);

imagettftext($im, $font_size, 0, $dx_text, 15, -$color, $font, $text);
imagepng($im);
imagedestroy($im);
?>

 

Link to comment
https://forums.phpfreaks.com/topic/112567-low-font-quality-gd/
Share on other sites

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.