<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.image.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.imageloadfont.php',
    1 => 'imageloadfont',
    2 => 'L&auml;dt eine neue Schriftart',
  ),
  'up' => 
  array (
    0 => 'ref.image.php',
    1 => 'GD- und Image-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.imageline.php',
    1 => 'imageline',
  ),
  'next' => 
  array (
    0 => 'function.imageopenpolygon.php',
    1 => 'imageopenpolygon',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/image/functions/imageloadfont.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imageloadfont" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imageloadfont</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imageloadfont</span> &mdash; <span class="dc-title">Lädt eine neue Schriftart</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.imageloadfont-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imageloadfont</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$filename</code></span>): <span class="type"><span class="type"><a href="class.gdfont.php" class="type GdFont">GdFont</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>ImageLoadFont()</strong></span> lädt eine benutzerdefinierte
   Bitmap-Schriftart und gibt deren Kennung zurück.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.imageloadfont-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">filename</code></dt>
     <dd>
      <p class="para">
       Das Schriftart-Dateiformat ist zurzeit ein architekturabhängiges,
       binäres Format. Das bedeutet, dass Schriftart-Dateien immer auf
       derselben Architektur erzeugt werden müssen, auf dem diese verwendet
       werden sollen.
      </p>
      <p class="para">
       <table class="doctable table">
        <caption><strong>Scrhiftart-Dateiformat</strong></caption>
        
         <thead>
         <tr>
          <th>Byte-Position</th>
          <th>C Daten-Typ</th>
          <th>Beschreibung</th>
         </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td>Byte 0-3</td>
           <td>int</td>
           <td>Anzahl der Zeichen der Schriftart</td>
          </tr>

          <tr>
           <td>Byte 4-7</td>
           <td>int</td>
           <td>
            Wert des ersten Zeichens der Schriftart (meist 32 für Leerzeichen)
           </td>
          </tr>

          <tr>
           <td>Byte 8-11</td>
           <td>int</td>
           <td>Pixel-Breite jedes Zeichens</td>
          </tr>

          <tr>
           <td>Byte 12-15</td>
           <td>int</td>
           <td>Pixel-Höhe jedes Zeichens</td>
          </tr>

          <tr>
           <td>Byte 16-</td>
           <td>char</td>
           <td>
            Zeichen-Daten als Array, ein Byte je Pixel für jedes Zeichen; in
            der Summe also insgesamt (Anzahl Zeichen * Breite * Höhe) Byte.
           </td>
          </tr>

         </tbody>
        
       </table>

      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.imageloadfont-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt eine <span class="classname"><a href="class.gdfont.php" class="classname">GdFont</a></span>-Instanz zurück.
   Bei einem Fehler wird <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurückgegeben.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imageloadfont-changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Beschreibung</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.1.0</td>
       <td>
        Gibt nun eine <span class="classname"><a href="class.gdfont.php" class="classname">GdFont</a></span>-Instanz zurück; vorher
        wurde ein <a href="language.types.integer.php" class="link">Integer</a> zurückgegeben.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.imageloadfont-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 <span class="function"><strong>imageloadfont()</strong></span>-Beispiel</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// Erzeuge ein neues Bild<br /></span><span style="color: #0000BB">$im </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecreatetruecolor</span><span style="color: #007700">(</span><span style="color: #0000BB">50</span><span style="color: #007700">, </span><span style="color: #0000BB">20</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$black </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$white </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Färbe den Hintergrund weiß<br /></span><span style="color: #0000BB">imagefilledrectangle</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">49</span><span style="color: #007700">, </span><span style="color: #0000BB">19</span><span style="color: #007700">, </span><span style="color: #0000BB">$white</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Lade die GD-Schriftart und schreibe 'Hallo'<br /></span><span style="color: #0000BB">$font </span><span style="color: #007700">= </span><span style="color: #0000BB">imageloadfont</span><span style="color: #007700">(</span><span style="color: #DD0000">'./04b.gdf'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">imagestring</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">$font</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #DD0000">'Hallo'</span><span style="color: #007700">, </span><span style="color: #0000BB">$black</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Ausgabe an Browser<br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-type: image/png'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">imagepng</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.imageloadfont-seealso">
  <h3 class="title">Siehe auch</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.imagefontwidth.php" class="function" rel="rdfs-seeAlso">imagefontwidth()</a> - Ermittelt die Breite einer Schriftart</span></li>
   <li><span class="function"><a href="function.imagefontheight.php" class="function" rel="rdfs-seeAlso">imagefontheight()</a> - Ermittelt die H&ouml;he einer Schriftart</span></li>
   <li><span class="function"><a href="function.imagestring.php" class="function" rel="rdfs-seeAlso">imagestring()</a> - Zeichnet einen horizontalen String</span></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>