Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 3712

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Change the character encoding vector of a font</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.imagepsbbox.html">imagepsbbox</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.imagepsextendfont.html">imagepsextendfont</a></div>
 <div class="up"><a href="ref.image.html">GD and Image Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.imagepsencodefont" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagepsencodefont</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">imagepsencodefont</span> &mdash; <span class="dc-title">Change the character encoding vector of a font</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imagepsencodefont-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>imagepsencodefont</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$font_index</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$encodingfile</code></span>
   )</div>

  <p class="para rdfs-comment">
   Loads a character encoding vector from a file and changes the fonts 
   encoding vector to it. As a PostScript fonts default vector lacks most of
   the character positions above 127, you&#039;ll definitely want to change this
   if you use an other language than English. 
  </p>
  <p class="para">
   If you find yourself using this function all the time, a much
   better way to define the encoding is to set ps.default_encoding in
   the <a href="configuration.file.html" class="link">configuration file</a>
   to point to the right encoding file and all fonts you load will
   automatically have the right encoding.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.imagepsencodefont-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>

     <span class="term"><em><code class="parameter">font_index</code></em></span>
     <dd>

      <p class="para">
       A font resource, returned by  <span class="function"><a href="function.imagepsloadfont.html" class="function">imagepsloadfont()</a></span>.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">encodingfile</code></em></span>
     <dd>

      <p class="para">
       The exact format of this file is described in T1libs documentation. 
       T1lib comes with two ready-to-use files, 
       <var class="filename">IsoLatin1.enc</var> and 
       <var class="filename">IsoLatin2.enc</var>.
      </p>
     </dd>

    </dt>

   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imagepsencodefont-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure.
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-function.imagepsencodefont-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-3265">
    <p><strong>Example #1  <span class="function"><strong>imagepsencodefont()</strong></span> example</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">//&nbsp;Load&nbsp;a&nbsp;.pfb&nbsp;font&nbsp;file<br /></span><span style="color: #0000BB">$font&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imagepsloadfont</span><span style="color: #007700">(</span><span style="color: #DD0000">'./px3l.pfb'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Tell&nbsp;T1lib&nbsp;to&nbsp;use&nbsp;ISO&nbsp;Latin&nbsp;1&nbsp;encoding<br /></span><span style="color: #0000BB">imagepsencode</span><span style="color: #007700">(</span><span style="color: #0000BB">$font</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'./IsoLatin1.enc'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Do&nbsp;any&nbsp;operations&nbsp;with&nbsp;the&nbsp;font&nbsp;here<br /><br />//&nbsp;Free&nbsp;the&nbsp;font&nbsp;from&nbsp;memory<br /></span><span style="color: #0000BB">imagepsfreefont</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>
  </p>
 </div>

 <div class="refsect1 notes" id="refsect1-function.imagepsencodefont-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">This function is only available
if PHP is compiled using <strong class="option configure">--with-t1lib[=DIR]</strong>
.
</span></p></blockquote>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.imagepsbbox.html">imagepsbbox</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.imagepsextendfont.html">imagepsextendfont</a></div>
 <div class="up"><a href="ref.image.html">GD and Image Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>