mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-19 06:16:58 +08:00
397 lines
10 KiB
HTML
397 lines
10 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>Output text in a box</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.ps-show-boxed" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">ps_show_boxed</h1>
|
|
<p class="verinfo">(PECL ps >= 1.1.0)</p><p class="refpurpose"><span class="refname">ps_show_boxed</span> — <span class="dc-title">Output text in a box</span></p>
|
|
|
|
</div>
|
|
|
|
<div class="refsect1 description" id="refsect1-function.ps-show-boxed-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>ps_show_boxed</strong></span>
|
|
( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$psdoc</code></span>
|
|
, <span class="methodparam"><span class="type">string</span> <code class="parameter">$text</code></span>
|
|
, <span class="methodparam"><span class="type">float</span> <code class="parameter">$left</code></span>
|
|
, <span class="methodparam"><span class="type">float</span> <code class="parameter">$bottom</code></span>
|
|
, <span class="methodparam"><span class="type">float</span> <code class="parameter">$width</code></span>
|
|
, <span class="methodparam"><span class="type">float</span> <code class="parameter">$height</code></span>
|
|
, <span class="methodparam"><span class="type">string</span> <code class="parameter">$hmode</code></span>
|
|
[, <span class="methodparam"><span class="type">string</span> <code class="parameter">$feature</code></span>
|
|
] ) : <span class="type">int</span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
Outputs a text in a given box. The lower left corner of the box is at
|
|
(<code class="parameter">left</code>, <code class="parameter">bottom</code>). Line breaks
|
|
will be inserted where needed. Multiple spaces are treated as one.
|
|
Tabulators are treated as spaces.
|
|
</p>
|
|
<p class="para">
|
|
The text will be hyphenated if the parameter
|
|
<code class="parameter">hyphenation</code> is set to <strong><code>TRUE</code></strong>
|
|
and the parameter <code class="parameter">hyphendict</code> contains a valid
|
|
filename for a hyphenation
|
|
file. The line spacing is taken from the value <em>leading</em>.
|
|
Paragraphs can be
|
|
separated by an empty line just like in TeX. If the value
|
|
<em>parindent</em> is
|
|
set to value > 0.0 then the first n lines will be indented. The number n
|
|
of lines is set by the parameter <em>numindentlines</em>.
|
|
In order to prevent
|
|
indenting of the first m paragraphs set the value
|
|
<em>parindentskip</em> to a
|
|
positive number.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.ps-show-boxed-parameters">
|
|
<h3 class="title">参数</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="ps_new.html" class="function">ps_new()</a></span>.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">text</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The text to be output into the given box.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">left</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
x-coordinate of the lower left corner of the box.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">bottom</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
y-coordinate of the lower left corner of the box.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">width</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
Width of the box.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">height</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
Height of the box.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">hmode</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The parameter <code class="parameter">hmode</code> can be "justify",
|
|
"fulljustify", "right", "left", or "center". The difference of
|
|
"justify" and "fulljustify" just affects the last line of the box. In
|
|
fulljustify mode the last line will be left and right justified unless
|
|
this is also the last line of paragraph. In justify mode it will always
|
|
be left justified.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">feature</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 unknown-parametert" id="refsect1-function.ps-show-boxed-unknown-parametert">
|
|
<h3 class="title">Used parameters</h3>
|
|
<p class="para">
|
|
The output of <span class="function"><strong>ps_show_boxed()</strong></span> can be configured with
|
|
several parameters and values which must be set with either
|
|
<span class="function"><a href="ps_set_parameter.html" class="function">ps_set_parameter()</a></span> or <span class="function"><a href="ps_set_value.html" class="function">ps_set_value()</a></span>.
|
|
Beside the parameters and values which affect text output, the following
|
|
parameters and values are evaluated.
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
leading (value)</dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">Distance between baselines of two consecutive lines.</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
linebreak (parameter)</dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
Set to "true" if you want a carriage return to start a new line instead
|
|
of treating it as a space. Defaults to "false".
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
parbreak (parameter)</dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
Set to "true" if you want a carriage return on a single line to start a
|
|
new paragraph instead of treating it as a space. Defaults to "true".
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
hyphenation (parameter)</dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
Set to "true" in order to turn hyphenation on. This requires a
|
|
dictionary to be set with the parameter "hyphendict". Defaults to
|
|
"false".
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
hyphendict (parameter)</dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
Filename of the dictionary used for hyphenation pattern (see below).
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
hyphenminchar (value)</dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The number of chars which must at least be left over before or after
|
|
the hyphen. This implies that only words of at least two times this
|
|
value will be hyphenated. The default value is three. Setting a value
|
|
of zero will result in the default value.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
parindent (value)</dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
Set the amount of space in pixel for indenting the first m lines of a
|
|
paragraph. m can be set with the value "numindentlines".
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
parskip (value)</dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
Set the amount of extra space in pixel between paragraphs. Defaults to
|
|
0 which will result in a normal line distance.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
numindentlines (value)</dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
Number of lines from the start of the paragraph which will be indented.
|
|
Defaults to 1.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
parindentskip (value)</dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
Number of paragraphs in the box whose first lines will not be indented.
|
|
This defaults to 0. This is useful for paragraphs right after a section
|
|
heading or text being continued in a second box. In both case one would
|
|
set this to 1.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
linenumbermode (parameter)</dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
Set how lines are to be numbered. Possible values are "box" for
|
|
numbering lines in the whole box or "paragraph" to number lines within
|
|
each paragraph.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
linenumberspace (value)</dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The space for the column left of the numbered line containing the line
|
|
number. The line number will be right justified into this column.
|
|
Defaults to 20.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
linenumbersep (value)</dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The space between the column with line numbers and the line itself.
|
|
Defaults to 5.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 unknown-unknown-parameteru" id="refsect1-function.ps-show-boxed-unknown-unknown-parameteru">
|
|
<h3 class="title">Hyphenation</h3>
|
|
<p class="para">
|
|
Text is hyphenated if the parameter <em>hyphenation</em> is set
|
|
to true and a valid hyphenation dictionary is set. pslib does not ship its own
|
|
hyphenation dictionary but uses one from openoffice, scribus or koffice.
|
|
You can find their dictionaries for different languages in one of the
|
|
following directories if the software is installed:
|
|
<ul class="simplelist">
|
|
<li class="member">
|
|
<var class="filename">/usr/share/apps/koffice/hyphdicts/</var>
|
|
</li>
|
|
<li class="member">
|
|
<var class="filename">/usr/lib/scribus/dicts/</var>
|
|
</li>
|
|
<li class="member">
|
|
<var class="filename">/usr/lib/openoffice/share/dict/ooo/</var>
|
|
</li>
|
|
</ul>
|
|
Currently scribus appears to have the most complete hyphenation
|
|
dictionaries.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.ps-show-boxed-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
Number of characters that could not be written.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 seealso" id="refsect1-function.ps-show-boxed-seealso">
|
|
<h3 class="title">参见</h3>
|
|
<p class="para">
|
|
<ul class="simplelist">
|
|
<li class="member"><span class="function"><a href="ps_continue_text.html" class="function" rel="rdfs-seeAlso">ps_continue_text()</a> - Continue text in next line</span></li>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
|
|
</div></div></div></body></html> |