aktuelle.kurse/m133/Modul_Unterlagen_133_VOR/08-Uebungen/03 PHP Grundlagen/PHP_Referenz/funktionsreferenz/image_funktionen/imagettfbbox.html
Harald G. Mueller 28ff49e098 muh
2023-06-29 07:50:41 +02:00

178 lines
9.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>imagettfbbox</title>
<link rel="stylesheet" type="text/css" href="../../src/self.css">
<meta name="description" content="Ermittelt die Ma&szlig;e einer True-Type-Schrift">
<meta name="keywords" content="SELFPHP, PHP, Image-Funktionen, imagettfbbox">
<meta name="author" content="Damir Enseleit, mail@selfphp.info">
<meta name="DC.Contributer" content="Matthias Hupp, m.hupp@selfphp3.de">
<meta name="DC.Publisher" content="Damir Enseleit, mail@selfphp.info">
<meta name="DC.Date" content="2001-08-19T12:18+01:00">
<meta name="DC.Identifier" content="http://www.selfphp3.de/funktionsreferenz/image_funktionen/imagettfbbox.html">
<meta name="DC.Language" content="de">
<meta name="DC.Rights" content="../../editorial/index.html">
<meta name="SELF.Firstdate" content="2001-08-19T12:18+01:00">
<meta name="SELF.Version" content="1">
<meta name="SELF.Pagetype" content="Information">
<meta name="SELF.Path" content="SELFPHP == ../../index.php // Funktionsreferenz == ../index.php // Image-Funktionen == index.html">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#AA5522" vlink="#772200" alink="#000000">
<table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr>
<td bgcolor="#FFEEDD" class="nav"><a class="an" name="top"><img src="../../src/refkap.gif" width="16" height="13" border="0" alt="Teil von"></a> <a href="../../index.html"><b>SELFPHP</b></a>/<a href="../../navigation/index.html">Navigationshilfen</a> <img src="../../src/refkap.gif" width="16" height="13" border="0" alt="Teil von"> <a href="../index.html"><b>Funktionsreferenz</b></a> <img src="../../src/refkap.gif" width="16" height="13" border="0" alt="Teil von"> <a href="index.html"><b>Image-Funktionen</b></a></td>
</tr>
</table>
<table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr>
<td bgcolor="#EEEEEE" class="doc" width="110"><img src="../../src/logo.gif" width="106" height="109" border="0" alt="SEL.html"></td>
<td bgcolor="#EEEEEE" class="doc" valign="bottom" width="100%">
<h2>imagettfbbox</h2></td>
</tr>
<tr>
<td bgcolor="#EEEEEE" class="doc" valign="top" align="center"> <img src="../../src/dokx.gif" width="30" height="20" vspace="6" border="0" alt="Informationsseite">
</td>
<td bgcolor="#FFFFFF" valign="top" nowrap colspan="2">
<p> <img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten">&nbsp;<a href="#befehl"><b>Befehl</b></a><br>
<img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten">&nbsp;<a href="#version"><b>Version</b></a><br>
<img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten">&nbsp;<a href="#beschreibung"><b>Beschreibung</b></a><br>
<img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten">&nbsp;<a href="#beispiel"><b>Beispiel</b></a><br>
<img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten">&nbsp;<a href="#ausgabe"><b>Ausgabe</b></a><br>
</p>
</td>
</tr>
<tr>
<td colspan=3 bgcolor="#EEEEEE" class="doc"><a href="#bottom"><img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"></a>&#160;</td>
</tr>
</table>
<h2 class="Sh2"><a class="an" name="befehl">Befehl</a></h2>
<table width="100%" cellpadding=10><tr>
<td class="xmpcode" bgcolor="#E4EEFF">array <b>imagettfbbox</b>(int size,
int angle, string fontfile, string text)</td>
</tr></table>
<p>&nbsp;</p>
<table bgcolor="#EEEEEE" class="doc" width="100%"><tr><td>
<a href="#top"><img src="../../src/up.gif" width="14" height="10" border="0" alt="nach oben"></a><a href="#bottom"><img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"></a>&#160;
</td></tr></table>
<h2 class="Sh2"><a class="an" name="version">Version</a></h2>
<table width="100%" cellpadding=10 height="32">
<tr>
<td class="xmpcode" bgcolor="#E4EEFF" height="20">
<p>PHP 3 &gt;= 3.0.1, PHP 4 &gt;= 4.0b1</p>
</td>
</tr></table>
<p>&nbsp;</p>
<table bgcolor="#EEEEEE" class="doc" width="100%"><tr><td>
<a href="#top"><img src="../../src/up.gif" width="14" height="10" border="0" alt="nach oben"></a><a href="#bottom"><img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"></a>&#160;
</td></tr></table>
<h2 class="Sh2"><a class="an" name="beschreibung">Beschreibung</a></h2>
<table width="100%" cellpadding=10 height="141">
<tr>
<td class="xmpcode" bgcolor="#E4EEFF" height="57">
<p>Mit imagettfbbox() kann man die Au&szlig;enma&szlig;e f&uuml;r die Ausgabe
eines Textes im<br>
TrueType-Format ermitteln. Als Parameter wird die Schriftgr&ouml;&szlig;e
(size), der<br>
Schriftwinkel (angle), der Name der TTF-Datei als URL oder absoluter Pfad<br>
(fontfile) und der auszugebende Text (text) ben&ouml;tigt. Als R&uuml;ckgabewert
erhalten<br>
Sie ein Array mit den genauen XY-Koordinaten aller vier Ecken der Schrift.
Im<br>
unteren Beispiel gab der Funktionsaufruf folgende Werte zur&uuml;ck:<br>
1 , -1 , 320 , -1 , 320 , -18 , 1 , -18<br>
Mit diesen Daten k&ouml;nnte man wie im unteren Beispiel gezeigt einen
Kasten um<br>
den Text platzieren.<br>
</p>
<p>Siehe auch:</p>
<ul>
<li><a href="imagecreate.html">imagecreate()</a></li>
<li> <a href="imagecolorallocate.html">imagecolorallocate()</a></li>
<li><a href="imagettftext.html">imagettftext()</a></li>
<li><a href="imagegif.html">imagegif()</a></li>
<li><a href="imagedestroy.html">imagedestroy()</a></li>
</ul>
</td>
</tr></table>
<p>&nbsp;</p>
<table bgcolor="#EEEEEE" class="doc" width="100%"><tr><td>
<a href="#top"><img src="../../src/up.gif" width="14" height="10" border="0" alt="nach oben"></a><a href="#bottom"><img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"></a>&#160;
</td></tr></table>
<h2 class="Sh2"><a class="an" name="beispiel">Beispiel</a></h2>
<table width="100%" cellpadding=10 height="56">
<tr>
<td class="xmpcode" bgcolor="#E4EEFF">
<pre>&lt;?PHP<br>$size = 24; <br>$textwerte = imagettfbbox($size, 0, &quot;arial.ttf&quot;, &quot;PHP &frac34; - Die Befehlsreferenz&quot;); <br>$textwerte[2] += 8;<br>$textwerte[5] = abs($textwerte[5]);<br>$textwerte[5] += 4;<br>$image=imagecreate($textwerte[2], $textwerte[5]); <br>$farbe_body=imagecolorallocate($image,222,222,222); <br>$farbe_b = imagecolorallocate($image,10,36,106);<br>$textwerte[5] -= 2;<br>imagettftext ($image, $size, 0, 4,$textwerte[5],$farbe_b, &quot;arial.ttf&quot;, &quot;PHP &frac34; - Die Befehlsreferenz&quot;); <br>imagegif($image, &quot;image.gif&quot;); <br>imagedestroy($image);<br>?&gt; <br>&lt;img src=&quot;image.gif&quot; border=0&gt;</pre>
<p></p>
</td>
</tr></table>
<p>&nbsp;</p>
<table bgcolor="#EEEEEE" class="doc" width="100%"><tr><td>
<a href="#top"><img src="../../src/up.gif" width="14" height="10" border="0" alt="nach oben"></a><a href="#bottom"><img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"></a>&#160;
</td></tr></table>
<h2 class="Sh2"><a class="an" name="ausgabe">Ausgabe</a></h2>
<table width="100%" cellpadding=10 height="44">
<tr>
<td class="xmpcode" bgcolor="#E4EEFF" height="57">
<p><img src="../funktionsgrafiken/imagettfbbox.gif" width="395" height="229"></p>
</td>
</tr></table>
<p>&nbsp;</p>
<table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr><td colspan=2 bgcolor="#EEEEEE" class="doc">
<a href="#top"><img src="../../src/up.gif" width="14" height="10" border="0" alt="nach oben"></a>
</td></tr>
<tr>
<td bgcolor="#EEEEEE" class="doc" align="right" width="110">weiter:<a href="imagettftext.html"><img src="../../src/next.gif" width="10" height="10" border="0" hspace="10" alt="weiter"></a></td>
<td bgcolor="#FFFFFF"><img src="../../src/dok.gif" width="15" height="10" border="0" alt="Seite">
<a href="imagettftext.html"><b>imagettftext</b></a> </td>
</tr>
<tr>
<td bgcolor="#EEEEEE" class="doc" align="right" width="110">zur&uuml;ck:<a href="imagesy.html"><img src="../../src/prev.gif" width="10" height="10" border="0" hspace="10" alt="zur&uuml;ck"></a></td>
<td bgcolor="#FFFFFF" width="100%"><img src="../../src/dok.gif" width="15" height="10" border="0" alt="Seite">
<a href="imagesy.html"><b>imagesy</b></a> </td>
</tr>
<tr><td colspan=2 bgcolor="#EEEEEE" class="doc">&#160;</td></tr>
</table><table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr>
<td bgcolor="#FFEEDD" class="nav"><a class="an" name="bottom"><img src="../../src/refkap.gif" width="16" height="13" border="0" alt="Teil von"></a>
<a href="../../index.html"><b>SELFPHP</b></a>/<a href="../../navigation/index.html">Navigationshilfen</a> <img src="../../src/refkap.gif" width="16" height="13" border="0" alt="Teil von">
<a href="../index.html"><b>Funktionsreferenz</b></a> <img src="../../src/refkap.gif" width="16" height="13" border="0" alt="Teil von">
<a href="index.html"><b>Image-Funktionen</b></a></td>
</tr>
</table>
<p><a class="an" name="bottom">&copy; 2001, 2002, 2003</A> <img src="../../src/mail.gif" width="15" height="10" border="0" alt="E-Mail">&nbsp;<a href="mailto:mail@selfphp.info">Damir Enseleit, mail@selfphp.info</a></p>
</body>
</html>