note 91061 added to function.imagettftext

From: Date: Fri, 22 May 2009 19:50:23 +0000
Subject: note 91061 added to function.imagettftext
Groups: php.notes 
Request: Send a blank email to php-notes+get-155897@lists.php.net to get a copy of this message
I was having trouble trying to render non antialiased text using a pixel font. The tips about setting a negative value for the color are valid, but I was still having trouble with the text I was trying to render because it was black. I discovered that if I changed the imagecolorallocate() function from: $color = imagecolorallocate($base, 0, 0, 0); to $color = imagecolorallocate($base, 1, 1, 1); (near black) and then used the negative value for the color in imagettftext(), it would work properly. The difference is that my first implementation set $color = 0. Obviously, you can't have $color = -0, it made no difference. When I switched to (1,1,1) it became $color = 1 which I could take a negative value for. ---- Server IP: 64.71.164.2 Probable Submitter: 76.105.221.87 ---- Manual Page -- http://www.php.net/manual/en/function.imagettftext.php Edit -- https://master.php.net/note/edit/91061 Del: integrated -- https://master.php.net/note/delete/91061/integrated Del: useless -- https://master.php.net/note/delete/91061/useless Del: bad code -- https://master.php.net/note/delete/91061/bad+code Del: spam -- https://master.php.net/note/delete/91061/spam Del: non-english -- https://master.php.net/note/delete/91061/non-english Del: in docs -- https://master.php.net/note/delete/91061/in+docs Del: other reasons-- https://master.php.net/note/delete/91061 Reject -- https://master.php.net/note/reject/91061 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#155897) next »