note 55972 added to function.imageloadfont

From: Date: Fri, 19 Aug 2005 13:19:14 +0000
Subject: note 55972 added to function.imageloadfont
Groups: php.notes 
Request: Send a blank email to php-notes+get-93896@lists.php.net to get a copy of this message
Two functions to write a string that is right aligned, or centered: <? function ImageStringRight($image, $font, $y, $str, $col,$r_padding=0) { global $$image; $font_width = imagefontwidth($font); $str_width = strlen($str)*$font_width; ImageString($image, $font, imagesx($image)-$str_width-$r_padding, $y, $str, $col); } function ImageStringCenter($image, $font, $y, $str, $col) { global $$image; $font_width = imagefontwidth($font); $str_width = strlen($str)*$font_width; ImageString($image, $font, intval((imagesx($image)-$str_width)/2), $y, $str, $col); } ?> for more such wonders, check out http://www.puremango.co.uk ---- Manual Page -- http://www.php.net/manual/en/function.imageloadfont.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+55972 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55972&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55972&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55972&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55972&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55972&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55972&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+55972&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#93896) next »