From 6a709352e214e1a7a2d7895aba27060d0433d14f Mon Sep 17 00:00:00 2001 From: Aidan Lister Date: Mon, 20 Sep 2004 10:58:17 +0000 Subject: [PATCH] Incorporated the user notes. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@168841 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/image/functions/imagettftext.xml | 185 +++++++++++++++------ 1 file changed, 132 insertions(+), 53 deletions(-) diff --git a/reference/image/functions/imagettftext.xml b/reference/image/functions/imagettftext.xml index e98c02abd2..4d4eac0f21 100644 --- a/reference/image/functions/imagettftext.xml +++ b/reference/image/functions/imagettftext.xml @@ -1,5 +1,5 @@ - - + + @@ -20,71 +20,150 @@ stringtext - imagettftext draws the string - text in the image identified by - image, starting at coordinates - x, y (top left is 0, 0), at - an angle of angle in color - color, using the TrueType font file identified by - fontfile. Depending on which version of the GD - library that PHP is using, when fontfile does not - begin with a leading '/', '.ttf' will be appended to the filename and - the library will attempt to search for that filename along a - library-defined font path. - - - The coordinates given by x, - y will define the basepoint of the first - character (roughly the lower-left corner of the character). This - is different from the imagestring, where x, - y define the upper-left corner of the first character. - - - angle is in degrees, with 0 degrees being - left-to-right reading text (3 o'clock direction), and higher - values representing a counter-clockwise rotation. (i.e., a value - of 90 would result in bottom-to-top reading text). - - - fontfile is the path to the TrueType font - you wish to use. - - - text is the text string which may include - UTF-8 character sequences (of the form: &#123;) to access - characters in a font beyond the first 255. - - - color is the color index. Using the - negative of a color index has the effect of turning off - antialiasing. + + + image + + + The image resource. See imagecreate. + + + + + size + + + The font size. Depending on your version of GD, this should be + specified as the pixel size (GD1) or point size (GD2). + + + + + angle + + + The angle in degrees, with 0 degrees being left-to-right reading text. + Higher values represent a counter-clockwise rotation. For example, + a value of 90 would result in bottom-to-top reading text. + + + + + x + + + The coordinates given by x and + y will define the basepoint of the first + character (roughly the lower-left corner of the character). This + is different from the imagestring, where + x and y define the + upper-left corner of the first character. For example, "top left" + is 0, 0. + + + + + y + + + The y-ordinate. This sets the position of the fonts baseline, not + the very bottom of the character. + + + + + color + + + The color index. Using the negative of a color index has + the effect of turning off antialiasing. + See imagecolorallocate. + + + + + fontfile + + + The path to the TrueType font you wish to use. + + + Depending on which version of the GD library that PHP is using, when + fontfile does not begin with a leading + / then .ttf will be appended + to the filename and the library will attempt to search for that + filename along a library-defined font path. + + + When using versions of the GD library lower than 2.0.18, a "space" character, + rather than a semicolon, was used to define alternate paths to the font files. + Unintentional use of this feature will result in the warning message: + Warning: Could not find/open font. + + + + + text + + + The text string. + + + May include any UTF-8 character sequences + (of the form: &#123;) to access characters in a font beyond the + first 255. + + + If a character is used in the string which is not supported by the + font, a hollow rectangle will replace the character. + + + + imagettftext returns an array with 8 elements representing four points making the bounding box of the - text. The order of the points is lower left, lower right, upper + text. The order of the points is lower left, lower right, upper right, upper left. The points are relative to the text regardless of the angle, so "upper left" means in the top left-hand corner when you see the text horizontally. - This example script will produce a black JPEG 400x30 pixels, with - the words "Testing..." in white in the font Arial. <function>imagettftext</function> example + + This example script will produce a white PNG 400x30 pixels, with + the words "Testing..." in black (with grey shadow), in the font Arial. + ]]>