mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
die, GIF, die!
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@113018 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
3f1ae92e57
commit
e258fe297d
1 changed files with 27 additions and 24 deletions
|
@ -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: &#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: Ω");
|
||||
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: &#937;");
|
||||
imagejpeg($im);
|
||||
imagedestroy($im);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
|
Loading…
Reference in a new issue