<?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.imagefontwidth.php',
    1 => 'imagefontwidth',
    2 => 'Retourne la largeur de la police',
  ),
  'up' => 
  array (
    0 => 'ref.image.php',
    1 => 'Fonctions GD et images',
  ),
  'prev' => 
  array (
    0 => 'function.imagefontheight.php',
    1 => 'imagefontheight',
  ),
  'next' => 
  array (
    0 => 'function.imageftbbox.php',
    1 => 'imageftbbox',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/image/functions/imagefontwidth.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imagefontwidth" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagefontwidth</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imagefontwidth</span> &mdash; <span class="dc-title">Retourne la largeur de la police</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imagefontwidth-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imagefontwidth</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="class.gdfont.php" class="type GdFont">GdFont</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$font</code></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

  <p class="para rdfs-comment">
   Retourne la largeur de la police <code class="parameter">font</code> en pixels.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.imagefontwidth-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
<dt><code class="parameter">font</code></dt><dd><p class="para">
 Peut être 1, 2, 3, 4, 5 pour les polices internes d&#039;encodage Latin2
 (où les plus grands nombres correspondent aux polices larges) ou une instance
 de <span class="classname"><a href="class.gdfont.php" class="classname">GdFont</a></span> retourné par <span class="function"><a href="function.imageloadfont.php" class="function">imageloadfont()</a></span>.
</p></dd>
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.imagefontwidth-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne la largeur de la police.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imagefontwidth-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>
  Le paramètre <code class="parameter">font</code> accepte désormais une instance de <span class="classname"><a href="class.gdfont.php" class="classname">GdFont</a></span>
  et un <a href="language.types.integer.php" class="link">entier</a>; auparavant seulement un  <a href="language.types.integer.php" class="link">entier</a> était accepté.
 </td>
</tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.imagefontwidth-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>imagefontwidth()</strong></span> et les polices internes</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: #007700">echo </span><span style="color: #DD0000">'Largeur de la police : ' </span><span style="color: #007700">. </span><span style="color: #0000BB">imagefontwidth</span><span style="color: #007700">(</span><span style="color: #0000BB">4</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Résultat de l&#039;exemple ci-dessus est similaire à :</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Largeur de la police : 8</pre>
</div>
    </div>
   </div>
   <div class="example" id="example-2">
    <p><strong>Exemple #2 Exemple avec <span class="function"><strong>imagefontwidth()</strong></span> et <span class="function"><a href="function.imageloadfont.php" class="function">imageloadfont()</a></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">// Chargement d'une police .gdf<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">'anonymous.gdf'</span><span style="color: #007700">);<br /><br />echo </span><span style="color: #DD0000">'Largeur de la police : ' </span><span style="color: #007700">. </span><span style="color: #0000BB">imagefontwidth</span><span style="color: #007700">(</span><span style="color: #0000BB">$font</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Résultat de l&#039;exemple ci-dessus est similaire à :</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Largeur de la police : 23</pre>
</div>
    </div>
   </div>
  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-function.imagefontwidth-seealso">
  <h3 class="title">Voir aussi</h3>
  <ul class="simplelist">
   <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.imageloadfont.php" class="function" rel="rdfs-seeAlso">imageloadfont()</a> - Charge une nouvelle police</span></li>
  </ul>
 </div>

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