note 101661 added to function.imagick-queryfontmetrics

From: Date: Mon, 03 Jan 2011 09:49:00 +0000
Subject: note 101661 added to function.imagick-queryfontmetrics
Groups: php.notes 
Request: Send a blank email to php-notes+get-175406@lists.php.net to get a copy of this message
The following fields constitute my current PHP 5.2.1/Imagick 6.5.1 queryFontMetrics() return array (once setFontSize() and setFont() have been set): characterWidth: maximum character ("em") width characterHeight: maximum character height ascender: the height of character ascensions (i.e. the straight bit on a 'b') descender: the height of character descensions (i.e. the straight bit on a 'p') textWidth: width of drawn text in pixels textHeight: height of drawn text in pixels maxHorizontalAdvance: maximum pixels from start of one character to start of the next boundingBox: array of x1, y1, x2, y2 bounding borders originX, originY: ? originX seems to shadow the textWidth field, and originY has been zero thus far in my exploration. If you're looking to center text or locate it at an edge, though, use ImagickDraw::setGravity(int $gravity), where $gravity is one of the following constants: Imagick::GRAVITY_NORTHWEST Imagick::GRAVITY_NORTH Imagick::GRAVITY_NORTHEAST Imagick::GRAVITY_WEST Imagick::GRAVITY_CENTER Imagick::GRAVITY_EAST Imagick::GRAVITY_SOUTHWEST Imagick::GRAVITY_SOUTH Imagick::GRAVITY_SOUTHEAST Using setGravity() is far less finicky for the simpler tasks. ---- Server IP: 72.55.140.6 Probable Submitter: 24.207.49.186 ---- Manual Page -- http://www.php.net/manual/en/function.imagick-queryfontmetrics.php Edit -- https://master.php.net/note/edit/101661 Del: integrated -- https://master.php.net/note/delete/101661/integrated Del: useless -- https://master.php.net/note/delete/101661/useless Del: bad code -- https://master.php.net/note/delete/101661/bad+code Del: spam -- https://master.php.net/note/delete/101661/spam Del: non-english -- https://master.php.net/note/delete/101661/non-english Del: in docs -- https://master.php.net/note/delete/101661/in+docs Del: other reasons-- https://master.php.net/note/delete/101661 Reject -- https://master.php.net/note/reject/101661 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#175406) next »