reference/image/functions/imagettftext.xml
593ea510e853ff034e03f78a4be0daa41661c9d4
...
...
@@ -8,20 +8,29 @@
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
-
<type>array</type><methodname>imagettftext</methodname>
12
-
<methodparam><type>resource</type><parameter>image</parameter></methodparam>
11
+
<type class="union"><type>array</type><type>false</type></type><methodname>imagettftext</methodname>
12
+
<methodparam><type>GdImage</type><parameter>image</parameter></methodparam>
13
13
<methodparam><type>float</type><parameter>size</parameter></methodparam>
14
14
<methodparam><type>float</type><parameter>angle</parameter></methodparam>
15
15
<methodparam><type>int</type><parameter>x</parameter></methodparam>
16
16
<methodparam><type>int</type><parameter>y</parameter></methodparam>
17
17
<methodparam><type>int</type><parameter>color</parameter></methodparam>
18
-
<methodparam><type>string</type><parameter>fontfile</parameter></methodparam>
18
+
<methodparam><type>string</type><parameter>font_filename</parameter></methodparam>
19
19
<methodparam><type>string</type><parameter>text</parameter></methodparam>
20
+
<methodparam choice="opt"><type>array</type><parameter>options</parameter><initializer>[]</initializer></methodparam>
20
21
</methodsynopsis>
21
22
<para>
22
23
Writes the given <parameter>text</parameter> into the image using TrueType
23
24
fonts.
24
25
</para>
26
+
<note>
27
+
<para>
28
+
Prior to PHP 8.0.0, <function>imagefttext</function> was an extended variant of
29
+
<function>imagettftext</function> which additionally supported the
30
+
<parameter>extrainfo</parameter>.
31
+
As of PHP 8.0.0, <function>imagettftext</function> is an alias of <function>imagefttext</function>.
32
+
</para>
33
+
</note>
25
34
</refsect1>
26
35
<refsect1 role="parameters">
27
36
&reftitle.parameters;
...
...
@@ -76,43 +85,7 @@
76
85
</para>
77
86
</listitem>
78
87
</varlistentry>
79
-
<varlistentry>
80
-
<term><parameter>fontfile</parameter></term>
81
-
<listitem>
82
-
<para>
83
-
The path to the TrueType font you wish to use.
84
-
</para>
85
-
<para>
86
-
Depending on which version of the GD library PHP is using, <emphasis>when
87
-
<parameter>fontfile</parameter> does not begin with a leading
88
-
<literal>/</literal> then <literal>.ttf</literal> will be appended</emphasis>
89
-
to the filename and the library will attempt to search for that
90
-
filename along a library-defined font path.
91
-
</para>
92
-
<para>
93
-
When using versions of the GD library lower than 2.0.18, a <literal>space</literal> character,
94
-
rather than a semicolon, was used as the 'path separator' for different font files.
95
-
Unintentional use of this feature will result in the warning message:
96
-
<literal>Warning: Could not find/open font</literal>. For these affected versions, the
97
-
only solution is moving the font to a path which does not contain spaces.
98
-
</para>
99
-
<para>
100
-
In many cases where a font resides in the same directory as the script using it
101
-
the following trick will alleviate any include problems.
102
-
<programlisting role="php">
103
-
<![CDATA[
104
-
<?php
105
-
// Set the enviroment variable for GD
106
-
putenv('GDFONTPATH=' . realpath('.'));
107
-

108
-
// Name the font to be used (note the lack of the .ttf extension)
109
-
$font = 'SomeFont';
110
-
?>
111
-
]]>
112
-
</programlisting>
113
-
</para>
114
-
</listitem>
115
-
</varlistentry>
88
+
&gd.ttf.fontfile;
116
89
<varlistentry>
117
90
<term><parameter>text</parameter></term>
118
91
<listitem>
...
...
@@ -128,8 +101,7 @@ $font = 'SomeFont';
128
101
<para>
129
102
Named entities, such as &amp;copy;, are not supported. Consider using
130
103
<function>html_entity_decode</function>
131
-
to decode these named entities into UTF-8 strings (html_entity_decode()
132
-
supports this as of PHP 5.0.0).
104
+
to decode these named entities into UTF-8 strings.
133
105
</para>
134
106
<para>
135
107
If a character is used in the string which is not supported by the
...
...
@@ -151,30 +123,29 @@ $font = 'SomeFont';
151
123
Returns &false; on error.
152
124
</para>
153
125
</refsect1>
126
+

154
127
<refsect1 role="changelog">
155
128
&reftitle.changelog;
156
-
<para>
157
-
<informaltable>
158
-
<tgroup cols="2">
159
-
<thead>
160
-
<row>
161
-
<entry>&Version;</entry>
162
-
<entry>&Description;</entry>
163
-
</row>
164
-
</thead>
165
-
<tbody>
166
-
<row>
167
-
<entry>5.2.0</entry>
168
-
<entry>
169
-
It is now possible to specify an hexadecimal entity in
170
-
<parameter>text</parameter>.
171
-
</entry>
172
-
</row>
173
-
</tbody>
174
-
</tgroup>
175
-
</informaltable>
176
-
</para>
129
+
<informaltable>
130
+
<tgroup cols="2">
131
+
<thead>
132
+
<row>
133
+
<entry>&Version;</entry>
134
+
<entry>&Description;</entry>
135
+
</row>
136
+
</thead>
137
+
<tbody>
138
+
<row>
139
+
<entry>8.0.0</entry>
140
+
<entry>
141
+
The <parameter>options</parameter> has been added.
142
+
</entry>
143
+
</row>
144
+
</tbody>
145
+
</tgroup>
146
+
</informaltable>
177
147
</refsect1>
148
+

178
149
<refsect1 role="examples">
179
150
&reftitle.examples;
180
151
<para>
...
...
@@ -228,23 +199,16 @@ imagedestroy($im);
228
199
</refsect1>
229
200
<refsect1 role="notes">
230
201
&reftitle.notes;
231
-
<note>
232
-
<para>
233
-
This function requires both the GD library and the <link
234
-
xlink:href="&url.freetype;">FreeType</link> library.
235
-
</para>
236
-
</note>
202
+
&note.freetype;
237
203
</refsect1>
238
204
<refsect1 role="seealso">
239
205
&reftitle.seealso;
240
-
<para>
241
-
<simplelist>
242
-
<member><function>imagettfbbox</function></member>
243
-
</simplelist>
244
-
</para>
206
+
<simplelist>
207
+
<member><function>imagettfbbox</function></member>
208
+
<member><function>imagefttext</function></member>
209
+
</simplelist>
245
210
</refsect1>
246
211
</refentry>
247
-

248
212
<!-- Keep this comment at the end of the file
249
213
Local variables:
250
214
mode: sgml
251
215