php-doc-en/reference/image/functions/imagettfbbox.xml
Hartmut Holzgraefe 5b9fc29465 revision tags added
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@78496 c90b9560-bf6c-de11-be94-00142212c4b1
2002-04-17 06:45:35 +00:00

137 lines
3.9 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- splitted from ./en/functions/image.xml, last change in rev 1.2 -->
<refentry id="function.imagettfbbox">
<refnamediv>
<refname>imagettfbbox</refname>
<refpurpose>Give the bounding box of a text using TrueType fonts</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>imagettfbbox</methodname>
<methodparam><type>int</type><parameter>size</parameter></methodparam>
<methodparam><type>int</type><parameter>angle</parameter></methodparam>
<methodparam><type>string</type><parameter>fontfile</parameter></methodparam>
<methodparam><type>string</type><parameter>text</parameter></methodparam>
</methodsynopsis>
<para>
This function calculates and returns the bounding box in pixels
for a TrueType text.
<variablelist>
<varlistentry>
<term>
<parameter>text</parameter>
</term>
<listitem>
<simpara>The string to be measured.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>size</parameter>
</term>
<listitem>
<simpara>The font size in pixels.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>fontfile</parameter>
</term>
<listitem>
<simpara>
The name of the TrueType font file. (Can also be an URL.) Depending on
which version of the GD library that PHP is using, it may attempt to
search for files that do not begin with a leading '/' by appending
'.ttf' to the filename and searching along a library-defined font path.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<parameter>angle</parameter>
</term>
<listitem>
<simpara>
Angle in degrees in which <parameter>text</parameter> will be
measured.
</simpara>
</listitem>
</varlistentry>
</variablelist>
<function>imagettfbbox</function> returns an array with 8
elements representing four points making the bounding box of the
text:
<informaltable>
<tgroup cols="2">
<tbody>
<row>
<entry>0</entry>
<entry>lower left corner, X position</entry>
</row>
<row>
<entry>1</entry>
<entry>lower left corner, Y position</entry>
</row>
<row>
<entry>2</entry>
<entry>lower right corner, X position</entry>
</row>
<row>
<entry>3</entry>
<entry>lower right corner, Y position</entry>
</row>
<row>
<entry>4</entry>
<entry>upper right corner, X position</entry>
</row>
<row>
<entry>5</entry>
<entry>upper right corner, Y position</entry>
</row>
<row>
<entry>6</entry>
<entry>upper left corner, X position</entry>
</row>
<row>
<entry>7</entry>
<entry>upper left corner, Y position</entry>
</row>
</tbody>
</tgroup>
</informaltable>
The points are relative to the <emphasis>text</emphasis>
regardless of the angle, so "upper left" means in the top
left-hand corner seeing the text horizontallty.
</para>
<para>
This function requires both the GD library and the FreeType
library.
</para>
<para>
See also <function>imagettftext</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->