<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.ps.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'function.ps-findfont.php',
    1 => 'ps_findfont',
    2 => 'Loads a font',
  ),
  'up' => 
  array (
    0 => 'ref.ps.php',
    1 => 'PS Funzioni',
  ),
  'prev' => 
  array (
    0 => 'function.ps-fill-stroke.php',
    1 => 'ps_fill_stroke',
  ),
  'next' => 
  array (
    0 => 'function.ps-get-buffer.php',
    1 => 'ps_get_buffer',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/ps/functions/ps-findfont.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.ps-findfont" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ps_findfont</h1>
  <p class="verinfo">(PECL ps &gt;= 1.1.0)</p><p class="refpurpose"><span class="refname">ps_findfont</span> &mdash; <span class="dc-title">Loads a font</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.ps-findfont-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ps_findfont</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$psdoc</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$fontname</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$encoding</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$embed</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong></span></span><br>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

  <p class="para rdfs-comment">
   Loads a font for later use. Before text is output with a loaded font it
   must be set with <span class="function"><a href="function.ps-setfont.php" class="function">ps_setfont()</a></span>. This function needs the
   adobe font metric file in order to calculate the space used up by the
   characters. A font which is loaded within a page will only be available on
   that page. Fonts which are to be used in the complete document have to be
   loaded before the first call of <span class="function"><a href="function.ps-begin-page.php" class="function">ps_begin_page()</a></span>. Calling
   <span class="function"><strong>ps_findfont()</strong></span> between pages will make that font
   available for all following pages.
  </p>
  <p class="para">
   The name of the afm file must be
   <code class="parameter">fontname</code><code class="literal">.afm</code>. If the font
   shall be embedded the file
   <code class="parameter">fontname</code><code class="literal">.pfb</code> containing
   the font outline must be present as well.
  </p>
  <p class="para">
   Calling <span class="function"><strong>ps_findfont()</strong></span> before the first page requires
   to output the postscript header which includes the BoundingBox for
   the whole document. Usually the BoundingBox is set with the first call
   of <span class="function"><a href="function.ps-begin-page.php" class="function">ps_begin_page()</a></span> which now comes after
   <span class="function"><strong>ps_findfont()</strong></span>. Consequently the BoundingBox has not
   been set and a warning will be issued when <span class="function"><strong>ps_findfont()</strong></span>
   is called. In order to prevent this situation, one should call
   <span class="function"><a href="function.ps-set-parameter.php" class="function">ps_set_parameter()</a></span> to set the BoundingBox before
   <span class="function"><strong>ps_findfont()</strong></span> is called.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ps-findfont-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">psdoc</code></dt>
     <dd>
      <p class="para">
       Resource identifier of the postscript file
       as returned by <span class="function"><a href="function.ps-new.php" class="function">ps_new()</a></span>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">fontname</code></dt>
     <dd>
      <p class="para">
       The name of the font.
      </p>
     </dd>
    
    
     <dt><code class="parameter">encoding</code></dt>
     <dd>
      <p class="para">
       <span class="function"><strong>ps_findfont()</strong></span> will try to load the file passed in
       the parameter <code class="parameter">encoding</code>. Encoding files are of
       the same syntax as those used by <strong class="command">dvips(1)</strong>. They
       contain a font encoding vector (which is currently not used but must be
       present) and a list of extra ligatures to extend the list of ligatures
       derived from the afm file.
      </p>
      <p class="para">
       <code class="parameter">encoding</code> can be <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> or the empty string if
       the default encoding (TeXBase1) shall be used.
      </p>
      <p class="para">
       If the encoding is set to <code class="literal">builtin</code> then there
       will be no reencoding and the font specific encoding will be used. This
       is very useful with symbol fonts.
      </p>
     </dd>
    
    
     <dt><code class="parameter">embed</code></dt>
     <dd>
      <p class="para">
       If set to a value &gt;0 the font will be embedded into the document. This
       requires the font outline (.pfb file) to be present.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ps-findfont-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
   Returns the identifier of the font or zero in case of an error. The
   identifier is a positive number.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.ps-findfont-seealso">
  <h3 class="title">Vedere anche:</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.ps-begin-page.php" class="function" rel="rdfs-seeAlso">ps_begin_page()</a> - Start a new page</span></li>
    <li><span class="function"><a href="function.ps-setfont.php" class="function" rel="rdfs-seeAlso">ps_setfont()</a> - Sets font to use for following output</span></li>
   </ul>
  </p>
 </div>

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