cvs: phpdoc /en/reference/image/functions imagettftext.xml

From: Date: Wed, 22 Jan 2003 12:06:29 +0000
Subject: cvs: phpdoc /en/reference/image/functions imagettftext.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969351181@lists.php.net to get a copy of this message
dams Wed Jan 22 07:06:29 2003 EDT Modified files: /phpdoc/en/reference/image/functions imagettftext.xml Log: die, GIF, die! Index: phpdoc/en/reference/image/functions/imagettftext.xml diff -u phpdoc/en/reference/image/functions/imagettftext.xml:1.3 phpdoc/en/reference/image/functions/imagettftext.xml:1.4 --- phpdoc/en/reference/image/functions/imagettftext.xml:1.3 Thu Apr 18 13:13:10 2002 +++ phpdoc/en/reference/image/functions/imagettftext.xml Wed Jan 22 07:06:29 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- splitted from ./en/functions/image.xml, last change in rev 1.2 --> <refentry id="function.imagettftext"> <refnamediv> @@ -8,17 +8,17 @@ </refnamediv> <refsect1> <title>Description</title> - <methodsynopsis> - <type>array</type><methodname>imagettftext</methodname> - <methodparam><type>resource</type><parameter>image</parameter></methodparam> - <methodparam><type>int</type><parameter>size</parameter></methodparam> - <methodparam><type>int</type><parameter>angle</parameter></methodparam> - <methodparam><type>int</type><parameter>x</parameter></methodparam> - <methodparam><type>int</type><parameter>y</parameter></methodparam> - <methodparam><type>int</type><parameter>col</parameter></methodparam> - <methodparam><type>string</type><parameter>fontfile</parameter></methodparam> - <methodparam><type>string</type><parameter>text</parameter></methodparam> - </methodsynopsis> + <methodsynopsis> + <type>array</type><methodname>imagettftext</methodname> + <methodparam><type>resource</type><parameter>im</parameter></methodparam> + <methodparam><type>int</type><parameter>size</parameter></methodparam> + <methodparam><type>int</type><parameter>angle</parameter></methodparam> + <methodparam><type>int</type><parameter>x</parameter></methodparam> + <methodparam><type>int</type><parameter>y</parameter></methodparam> + <methodparam><type>int</type><parameter>col</parameter></methodparam> + <methodparam><type>string</type><parameter>fontfile</parameter></methodparam> + <methodparam><type>string</type><parameter>text</parameter></methodparam> + </methodsynopsis> <para> <function>imagettftext</function> draws the string <parameter>text</parameter> in the image identified by @@ -29,7 +29,7 @@ <parameter>fontfile</parameter>. Depending on which version of the GD library that PHP is using, when <parameter>fontfile</parameter> does not begin with a leading '/', '.ttf' will be appended to the filename and - the the library will attempt to search for that filename along a + the library will attempt to search for that filename along a library-defined font path. </para> <para> @@ -40,17 +40,17 @@ y define the upper-right corner of the first character. </para> <para> - <parameter>Angle</parameter> is in degrees, with 0 degrees being + <parameter>angle</parameter> 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). </para> <para> - <parameter>Fontfile</parameter> is the path to the TrueType font + <parameter>fontfile</parameter> is the path to the TrueType font you wish to use. </para> <para> - <parameter>Text</parameter> is the text string which may include + <parameter>text</parameter> is the text string which may include UTF-8 character sequences (of the form: &amp;#123;) to access characters in a font beyond the first 255. </para> @@ -71,17 +71,20 @@ This example script will produce a black GIF 400x30 pixels, with the words "Testing..." in white in the font Arial. <example> - <title>imagettftext</title> + <title><function>imagettftext</function> example</title> <programlisting role="php"> <![CDATA[ <?php -header ("Content-type: image/gif"); -$im = imagecreate (400, 30); -$black = imagecolorallocate ($im, 0, 0, 0); -$white = imagecolorallocate ($im, 255, 255, 255); -imagettftext ($im, 20, 0, 10, 20, $white, "/path/arial.ttf", "Testing...Omega: &#937;"); -imagegif ($im); -imagedestroy ($im); + header("Content-type: image/jpeg"); + $im = imagecreate(400,30); + $black = imagecolorallocate($im, 255,255,255); + $white = imagecolorallocate($im, 0,0,0); + + // Replace path by your own font path + imagettftext($im, 20, 0, 10, 20, $white, "/path/arial.ttf", + "Testing... Omega: &amp;#937;"); + imagejpeg($im); + imagedestroy($im); ?> ]]> </programlisting>

« previous php.doc (#969351181) next »