php-doc-en/reference/image/functions/imagepsencodefont.xml
Daniel Egeberg 96c9d88bad Converted to utf-8
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@297028 c90b9560-bf6c-de11-be94-00142212c4b1
2010-03-28 22:10:10 +00:00

110 lines
3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.imagepsencodefont" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>imagepsencodefont</refname>
<refpurpose>Change the character encoding vector of a font</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>imagepsencodefont</methodname>
<methodparam><type>resource</type><parameter>font_index</parameter></methodparam>
<methodparam><type>string</type><parameter>encodingfile</parameter></methodparam>
</methodsynopsis>
<para>
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'll definitely want to change this
if you use an other language than English.
</para>
<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 <link linkend="configuration.file">configuration file</link>
to point to the right encoding file and all fonts you load will
automatically have the right encoding.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>font_index</parameter></term>
<listitem>
<para>
A font resource, returned by <function>imagepsloadfont</function>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>encodingfile</parameter></term>
<listitem>
<para>
The exact format of this file is described in T1libs documentation.
T1lib comes with two ready-to-use files,
<filename>IsoLatin1.enc</filename> and
<filename>IsoLatin2.enc</filename>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>imagepsencodefont</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
// Load a .pfb font file
$font = imagepsloadfont('./px3l.pfb');
// Tell T1lib to use ISO Latin 1 encoding
imagepsencode($font, './IsoLatin1.enc');
// Do any operations with the font here
// Free the font from memory
imagepsfreefont($font);
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
&note.config.t1lib;
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->