📄 function.ps-findfont.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Loads a font</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.ps-fill.html">ps_fill</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.ps-get-buffer.html">ps_get_buffer</a></div> <div class="up"><a href="ref.ps.html">PS Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.ps-findfont" class="refentry"> <div class="refnamediv"> <h1 class="refname">ps_findfont</h1> <p class="verinfo">(PECL ps:1.1.0-1.3.5)</p><p class="refpurpose"><span class="refname">ps_findfont</span> — <span class="dc-title">Loads a font</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">int</span> <span class="methodname"><b><b>ps_findfont</b></b></span> ( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$psdoc</tt></span> , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$fontname</tt></span> , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$encoding</tt></span> [, <span class="methodparam"><span class="type">bool</span> <tt class="parameter">$embed</tt></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 <a href="function.ps-setfont.html" class="function">ps_setfont()</a>. 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 <a href="function.ps-begin-page.html" class="function">ps_begin_page()</a>. Calling <b>ps_findfont()</b> between pages will make that font available for all following pages. </p> <p class="para"> The name of the afm file must be <i><tt class="parameter">fontname</tt></i><i>.afm</i>. If the font shall be embedded the file <i><tt class="parameter">fontname</tt></i><i>.pfb</i> containing the font outline must be present as well. </p> <p class="para"> Calling <b>ps_findfont()</b> 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 <a href="function.ps-begin-page.html" class="function">ps_begin_page()</a> which now comes after <b>ps_findfont()</b>. Consequently the BoundingBox has not been set and a warning will be issued when <b>ps_findfont()</b> is called. In order to prevent this situation, one should call <a href="function.ps-set-parameter.html" class="function">ps_set_parameter()</a> to set the BoundingBox before <b>ps_findfont()</b> is called. </p> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">psdoc</tt></i></span> <dd> <p class="para"> Resource identifier of the postscript file as returned by <a href="function.ps-new.html" class="function">ps_new()</a>. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">fontname</tt></i></span> <dd> <p class="para"> The name of the font. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">encoding</tt></i></span> <dd> <p class="para"> <b>ps_findfont()</b> will try to load the file passed in the parameter <i><tt class="parameter">encoding</tt></i>. 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"> <i><tt class="parameter">encoding</tt></i> can be <b><tt>NULL</tt></b> or the empty string if the default encoding (TeXBase1) shall be used. </p> <p class="para"> If the encoding is set to <i>builtin</i> then there will be no reencoding and the font specific encoding will be used. This is very useful with symbol fonts. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">embed</tt></i></span> <dd> <p class="para"> If set to a value >0 the font will be embedded into the document. This requires the font outline (.pfb file) to be present. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</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"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"><a href="function.ps-begin-page.html" class="function" rel="rdfs-seeAlso">ps_begin_page()</a></li> <li class="member"><a href="function.ps-setfont.html" class="function" rel="rdfs-seeAlso">ps_setfont()</a></li> </ul> </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.ps-fill.html">ps_fill</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.ps-get-buffer.html">ps_get_buffer</a></div> <div class="up"><a href="ref.ps.html">PS Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -