|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-06-28 02:57 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 14:00:01 2025 UTC |
When I specify an absolute path to a font with ImageTTFText, such as "$DOCUMENT_ROOT/fonts/verdana.ttf", it displays the text twice on top of itself, but slightly misaligned to produce a blurring effect. I get this effect with all truetype fonts. ImagePSText does not exhibit this behavior. When I specify the font using a relative path, like "../../../../$DOCUMENT_ROOT/fonts/verdana.ttf", it displays fine. Here's an example of what causes the problem: $im = ImageCreate(100,100); $white = ImageColorAllocate ($im, 0xFF, 0xFF, 0xFF); $b $black = ImageColorAllocate ($im, 0x00, 0x00, 0x00); ImageTTFText($im,16,0,0,50,$black, "$DOCUMENT_ROOT/fonts/verdana.ttf","Testing..."); Header("Content-type: image/png"); ImagePNG($im); ImageDestroy($im); And here's what makes the problem go away: ImageTTFText($im,16,0,0,50,$black, "../../../../$DOCUMENT_ROOT/fonts/verdana.ttf", "Testing...");