php-doc-en/reference/ps/functions/ps-show-boxed.xml
Sergey Panteleev 9486a954ad
Fix issues in ps directory ()
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2021-08-15 22:49:02 +03:00

319 lines
10 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- splitted from ./en/functions/ps.xml, last change in rev 1.12 -->
<refentry xml:id="function.ps-show-boxed" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>ps_show_boxed</refname>
<refpurpose>Output text in a box</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>ps_show_boxed</methodname>
<methodparam><type>resource</type><parameter>psdoc</parameter></methodparam>
<methodparam><type>string</type><parameter>text</parameter></methodparam>
<methodparam><type>float</type><parameter>left</parameter></methodparam>
<methodparam><type>float</type><parameter>bottom</parameter></methodparam>
<methodparam><type>float</type><parameter>width</parameter></methodparam>
<methodparam><type>float</type><parameter>height</parameter></methodparam>
<methodparam><type>string</type><parameter>hmode</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>feature</parameter></methodparam>
</methodsynopsis>
<para>
Outputs a text in a given box. The lower left corner of the box is at
(<parameter>left</parameter>, <parameter>bottom</parameter>). Line breaks
will be inserted where needed. Multiple spaces are treated as one.
Tabulators are treated as spaces.
</para>
<para>
The text will be hyphenated if the parameter
<parameter>hyphenation</parameter> is set to &true;
and the parameter <parameter>hyphendict</parameter> contains a valid
filename for a hyphenation
file. The line spacing is taken from the value <literal>leading</literal>.
Paragraphs can be
separated by an empty line just like in TeX. If the value
<literal>parindent</literal> is
set to value &gt; 0.0 then the first n lines will be indented. The number n
of lines is set by the parameter <literal>numindentlines</literal>.
In order to prevent
indenting of the first m paragraphs set the value
<literal>parindentskip</literal> to a
positive number.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>psdoc</parameter></term>
<listitem>
<para>
Resource identifier of the postscript file
as returned by <function>ps_new</function>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>text</parameter></term>
<listitem>
<para>
The text to be output into the given box.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>left</parameter></term>
<listitem>
<para>
x-coordinate of the lower left corner of the box.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>bottom</parameter></term>
<listitem>
<para>
y-coordinate of the lower left corner of the box.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>width</parameter></term>
<listitem>
<para>
Width of the box.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>height</parameter></term>
<listitem>
<para>
Height of the box.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>hmode</parameter></term>
<listitem>
<para>
The parameter <parameter>hmode</parameter> can be <literal>justify</literal>,
<literal>fulljustify</literal>, <literal>right</literal>, <literal>left</literal>, or <literal>center</literal>.
The difference of <literal>justify</literal> and <literal>fulljustify</literal> just affects the last line of the box. In
<literal>fulljustify</literal> mode the last line will be left and right justified unless
this is also the last line of paragraph. In <literal>justify</literal> mode it will always
be left justified.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>feature</parameter></term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<refsect2>
<title>Used parameters</title>
<para>
The output of <function>ps_show_boxed</function> can be configured with
several parameters and values which must be set with either
<function>ps_set_parameter</function> or <function>ps_set_value</function>.
Beside the parameters and values which affect text output, the following
parameters and values are evaluated.
<variablelist>
<varlistentry>
<term>leading (value)</term>
<listitem>
<para>Distance between baselines of two consecutive lines.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>linebreak (parameter)</term>
<listitem>
<para>
Set to <literal>true</literal> if you want a carriage return to start a new line instead
of treating it as a space. Defaults to <literal>false</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>parbreak (parameter)</term>
<listitem>
<para>
Set to <literal>true</literal> if you want a carriage return on a single line to start a
new paragraph instead of treating it as a space. Defaults to <literal>true</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>hyphenation (parameter)</term>
<listitem>
<para>
Set to <literal>true</literal> in order to turn hyphenation on. This requires a
dictionary to be set with the parameter <parameter>hyphendict</parameter>. Defaults to
<literal>false</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>hyphendict (parameter)</term>
<listitem>
<para>
Filename of the dictionary used for hyphenation pattern (see below).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>hyphenminchar (value)</term>
<listitem>
<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.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>parindent (value)</term>
<listitem>
<para>
Set the amount of space in pixel for indenting the first m lines of a
paragraph. m can be set with the value <literal>numindentlines</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>parskip (value)</term>
<listitem>
<para>
Set the amount of extra space in pixel between paragraphs. Defaults to
<literal>0</literal> which will result in a normal line distance.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>numindentlines (value)</term>
<listitem>
<para>
Number of lines from the start of the paragraph which will be indented.
Defaults to <literal>1</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>parindentskip (value)</term>
<listitem>
<para>
Number of paragraphs in the box whose first lines will not be indented.
This defaults to <literal>0</literal>. 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 <literal>1</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>linenumbermode (parameter)</term>
<listitem>
<para>
Set how lines are to be numbered. Possible values are <literal>box</literal> for
numbering lines in the whole box or <literal>paragraph</literal> to number lines within
each paragraph.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>linenumberspace (value)</term>
<listitem>
<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 <literal>20</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>linenumbersep (value)</term>
<listitem>
<para>
The space between the column with line numbers and the line itself.
Defaults to <literal>5</literal>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect2>
<refsect2>
<title>Hyphenation</title>
<para>
Text is hyphenated if the parameter <literal>hyphenation</literal> 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:
<simplelist>
<member>
<filename class="directory">/usr/share/apps/koffice/hyphdicts/</filename>
</member>
<member>
<filename class="directory">/usr/lib/scribus/dicts/</filename>
</member>
<member>
<filename class="directory">/usr/lib/openoffice/share/dict/ooo/</filename>
</member>
</simplelist>
Currently scribus appears to have the most complete hyphenation
dictionaries.
</para>
</refsect2>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Number of characters that could not be written.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>ps_continue_text</function></member>
</simplelist>
</para>
</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
-->