<?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 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.imageloadfont.php',
    1 => 'imageloadfont',
    2 => 'Charge une nouvelle police',
  ),
  'up' => 
  array (
    0 => 'ref.image.php',
    1 => 'Fonctions GD et images',
  ),
  'prev' => 
  array (
    0 => 'function.imageline.php',
    1 => 'imageline',
  ),
  'next' => 
  array (
    0 => 'function.imageopenpolygon.php',
    1 => 'imageopenpolygon',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    '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">Charge une nouvelle police</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imageloadfont-description">
  <h3 class="title">Description</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> charge une nouvelle police utilisateur et
   retourne son identifiant.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.imageloadfont-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">filename</code></dt>
     <dd>
      <p class="para">
       Le format des polices dépend actuellement du système
       d&#039;exploitation. Ce qui signifie qu&#039;il faut générer
       des fichiers de polices pour la machine qui fait tourner PHP.
      </p>
      <p class="para">
       <table class="doctable table">
        <caption><strong>Format de fichier de police</strong></caption>
        
         <thead>
         <tr>
          <th>Position</th>
          <th>Type de données C</th>
          <th>Description</th>
         </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td>Octets 0-3</td>
           <td>int</td>
           <td>Nombre de caractères de la police</td>
          </tr>

          <tr>
           <td>Octets 4-7</td>
           <td>int</td>
           <td>
            Valeur du premier caractère de la police (souvent 32 pour espace)
           </td>
          </tr>

          <tr>
           <td>Octets 8-11</td>
           <td>int</td>
           <td>Largeur en pixels des caractères</td>
          </tr>

          <tr>
           <td>Octets 12-15</td>
           <td>int</td>
           <td>Hauteur en pixels des caractères</td>
          </tr>

          <tr>
           <td>Octets 16-</td>
           <td>char</td>
           <td>
            Tableau avec les données des caractères, un octet par pixel pour chaque
            caractère, avec un total de (nombre de caractères * largeur * hauteur) octets.
           </td>
          </tr>

         </tbody>
        
       </table>

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

 <div class="refsect1 returnvalues" id="refsect1-function.imageloadfont-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne une instance <span class="classname"><a href="class.gdfont.php" class="classname">GdFont</a></span>, ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si une erreur survient.
  </p>
 </div>


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

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.1.0</td>
       <td>
        Retourne désormais une instance de <span class="classname"><a href="class.gdfont.php" class="classname">GdFont</a></span>;
        auparavant, un <a href="language.types.integer.php" class="link">entier</a> était retourné.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.imageloadfont-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple avec <span class="function"><strong>imageloadfont()</strong></span></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">// Création d'une nouvelle image<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">// Définit l'arrière-plan en blanc<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">// Charge la police GD et écrit 'Bonjour !'<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">'Bonjour !'</span><span style="color: #007700">, </span><span style="color: #0000BB">$black</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Affichage sur le navigateur<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">Voir aussi</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.imagefontwidth.php" class="function" rel="rdfs-seeAlso">imagefontwidth()</a> - Retourne la largeur de la police</span></li>
   <li><span class="function"><a href="function.imagefontheight.php" class="function" rel="rdfs-seeAlso">imagefontheight()</a> - Retourne la hauteur de la police</span></li>
   <li><span class="function"><a href="function.imagestring.php" class="function" rel="rdfs-seeAlso">imagestring()</a> - Dessine une cha&icirc;ne horizontale</span></li>
  </ul>
 </div>

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