mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 22:06:57 +08:00
105 lines
5.1 KiB
HTML
105 lines
5.1 KiB
HTML
<!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>改变字体中的字符编码矢量</title>
|
||
</head>
|
||
<body class="docs"><div id="layout">
|
||
<div id="layout-content"><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> — <span class="dc-title">改变字体中的字符编码矢量</span></p>
|
||
|
||
</div>
|
||
<div class="refsect1 description" id="refsect1-function.imagepsencodefont-description">
|
||
<h3 class="title">说明</h3>
|
||
<div class="methodsynopsis dc-description">
|
||
<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>
|
||
) : <span class="type">bool</span></div>
|
||
|
||
<p class="para rdfs-comment">
|
||
从文件中加载字符编码矢量并用其替换给定字体的编码矢量。由于
|
||
PostScript 字体的默认矢量缺少大多数超过 127
|
||
的字符位置,因此如果使用其它非英语的语言的话肯定需要改变它。编码文件的确切格式定义在
|
||
T1lib 文档中。T1lib 包含有两个可马上使用的文件,IsoLatin1.enc
|
||
和 IsoLatin2.enc。
|
||
</p>
|
||
<p class="para">
|
||
如果发现自己总是要用本函数,更好的定义编码的做法是在<a href="configuration.file.html" class="link">配置文件</a>中将
|
||
ps.default_encoding 设定为指向正确的编码文件,这样加载的所有字体就会自动具有正确编码了。
|
||
</p>
|
||
<blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">此函数仅在 PHP
|
||
编译时指定了 <strong class="option configure">--with-t1lib[=DIR]</strong>
|
||
时可用。</span></p></blockquote>
|
||
</div>
|
||
|
||
<div class="refsect1 parameters" id="refsect1-function.imagepsencodefont-parameters">
|
||
<h3 class="title">参数</h3>
|
||
<p class="para">
|
||
<dl>
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">font_index</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
A font resource, returned by <span class="function"><a href="imagepsloadfont.html" class="function">imagepsloadfont()</a></span>.
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">encodingfile</code></dt>
|
||
|
||
<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>
|
||
|
||
|
||
</dl>
|
||
|
||
</p>
|
||
</div>
|
||
|
||
<div class="refsect1 returnvalues" id="refsect1-function.imagepsencodefont-returnvalues">
|
||
<h3 class="title">返回值</h3>
|
||
<p class="para">
|
||
成功时返回 <strong><code>TRUE</code></strong>, 或者在失败时返回 <strong><code>FALSE</code></strong>。
|
||
</p>
|
||
</div>
|
||
|
||
<div class="refsect1 examples" id="refsect1-function.imagepsencodefont-examples">
|
||
<h3 class="title">范例</h3>
|
||
<p class="para">
|
||
<div class="example" id="example-3727">
|
||
<p><strong>Example #1 <span class="function"><strong>imagepsencodefont()</strong></span> example</strong></p>
|
||
<div class="example-contents">
|
||
<div class="phpcode"><pre><span style="color: #000000">
|
||
<span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">// Load a .pfb font file<br /></span><span style="color: #0000BB">$font </span><span style="color: #007700">= </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">// Tell T1lib to use ISO Latin 1 encoding<br /></span><span style="color: #0000BB">imagepsencode</span><span style="color: #007700">(</span><span style="color: #0000BB">$font</span><span style="color: #007700">, </span><span style="color: #DD0000">'./IsoLatin1.enc'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// Do any operations with the font here<br /><br />// Free the font from 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">?></span>
|
||
</span>
|
||
</pre></div>
|
||
</div>
|
||
|
||
</div>
|
||
</p>
|
||
</div>
|
||
|
||
<div class="refsect1 notes" id="refsect1-function.imagepsencodefont-notes">
|
||
<h3 class="title">注释</h3>
|
||
<blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">此函数仅在 PHP
|
||
编译时指定了 <strong class="option configure">--with-t1lib[=DIR]</strong>
|
||
时可用。</span></p></blockquote>
|
||
</div>
|
||
|
||
</div></div></div></body></html> |