.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "PostScript::File::Functions 3pm" .TH PostScript::File::Functions 3pm "2018-01-01" "perl v5.26.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" PostScript::File::Functions \- Collection of useful PostScript functions .SH "VERSION" .IX Header "VERSION" This document describes version 2.23 of PostScript::File::Functions, released October 10, 2015 as part of PostScript-File version 2.23. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use PostScript::File; \& \& my $ps = PostScript::File\->new; \& $ps\->use_functions(qw( setColor showCenter )); \& $ps\->add_to_page("1 setColor\en" . \& "400 400 (Hello, World!) showCenter\en"); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" PostScript::File::Functions provides a library of handy PostScript functions that can be used in documents created with PostScript::File. You don't normally use this module directly; PostScript::File's \&\f(CW\*(C`use_functions\*(C'\fR method loads it automatically. .SH "POSTSCRIPT FUNCTIONS" .IX Header "POSTSCRIPT FUNCTIONS" .SS "boxPath" .IX Subsection "boxPath" .Vb 1 \& LEFT TOP RIGHT BOTTOM boxPath .Ve .PP Given the coordinates of the sides of a box, this creates a new, closed path starting at the bottom right corner, across to the bottom left, up to the top left, over to the top right, and then back to the bottom right. .SS "clipBox" .IX Subsection "clipBox" .Vb 1 \& LEFT TOP RIGHT BOTTOM clipBox .Ve .PP This clips to the box defined by the coordinates. .SS "drawBox" .IX Subsection "drawBox" .Vb 1 \& LEFT TOP RIGHT BOTTOM drawBox .Ve .PP This calls boxPath to and then strokes the path using the current pen. .SS "fillBox" .IX Subsection "fillBox" .Vb 1 \& LEFT TOP RIGHT BOTTOM COLOR fillBox .Ve .PP This fills the path created by boxPath with \f(CW\*(C`COLOR\*(C'\fR, which can be anything accepted by setColor. .SS "hLine" .IX Subsection "hLine" .Vb 1 \& WIDTH X Y hline .Ve .PP Stroke a horizontal line with the current pen with the left endpoint at position \f(CW\*(C`X, Y\*(C'\fR, extending \f(CW\*(C`WIDTH\*(C'\fR points rightwards. .SS "setColor" .IX Subsection "setColor" .Vb 1 \& RGB\-ARRAY|BW\-NUMBER setColor .Ve .PP This combines \f(CW\*(C`setgray\*(C'\fR and \f(CW\*(C`setrgbcolor\*(C'\fR into a single function. You can provide either an array of 3 numbers for \f(CW\*(C`setrgbcolor\*(C'\fR, or a single number for \f(CW\*(C`setgray\*(C'\fR. The \*(L"str\*(R" in PostScript::File function was designed to format the parameter to this function. .SS "showCenter" .IX Subsection "showCenter" .Vb 1 \& X Y STRING showCenter .Ve .PP This prints \f(CW\*(C`STRING\*(C'\fR centered horizontally at position X using baseline Y and the current font. .SS "showLeft" .IX Subsection "showLeft" .Vb 1 \& X Y STRING showLeft .Ve .PP This prints \f(CW\*(C`STRING\*(C'\fR left justified at position X using baseline Y and the current font. .SS "showLines" .IX Subsection "showLines" .Vb 1 \& X Y LINES SPACING FUNC showLines .Ve .PP This calls \f(CW\*(C`FUNC\*(C'\fR for each element of \f(CW\*(C`LINES\*(C'\fR, which should be an array of strings. \f(CW\*(C`FUNC\*(C'\fR is called with \f(CW\*(C`X Y STRING\*(C'\fR on the stack, and it must pop those off. \f(CW\*(C`SPACING\*(C'\fR is subtracted from \&\f(CW\*(C`Y\*(C'\fR after every line. \f(CW\*(C`FUNC\*(C'\fR will normally be \f(CW\*(C`showCenter\*(C'\fR, \&\f(CW\*(C`showLeft\*(C'\fR, or \f(CW\*(C`showRight\*(C'\fR. .SS "showRight" .IX Subsection "showRight" .Vb 1 \& X Y STRING showRight .Ve .PP This prints \f(CW\*(C`STRING\*(C'\fR right justified at position X using baseline Y and the current font. .SS "vLine" .IX Subsection "vLine" .Vb 1 \& HEIGHT X Y vline .Ve .PP Stroke a vertical line with the current pen with the bottom endpoint at position \f(CW\*(C`X, Y\*(C'\fR, extending \f(CW\*(C`HEIGHT\*(C'\fR points upwards. .SH "METHODS" .IX Header "METHODS" While you don't normally deal with PostScript::File::Functions objects directly, it is possible. The following methods are available: .SS "new" .IX Subsection "new" .Vb 1 \& $funcs = PostScript::File::Functions\->new; .Ve .PP The constructor takes no parameters. .SS "add" .IX Subsection "add" .Vb 1 \& $funcs\->add(\*(AqfunctionRequested\*(Aq, ...); .Ve .PP Add one or more functions to the procset to be generated. All dependencies of the requested functions are added automatically. See \&\*(L"\s-1POSTSCRIPT FUNCTIONS\*(R"\s0 for the list of available functions. .SS "add_to_file" .IX Subsection "add_to_file" .Vb 1 \& $funcs\->add_to_file($ps, $basename); .Ve .PP This is short for .PP .Vb 1 \& $ps\->add_procset( $funcs\->generate_procset($basename) ); .Ve .PP \&\f(CW$ps\fR should normally be a PostScript::File object. See \*(L"add_procset\*(R" in PostScript::File. .SS "generate_procset" .IX Subsection "generate_procset" .Vb 1 \& ($name, $code, $version) = $funcs\->generate_procset($basename); .Ve .PP This collects the requested functions into a block of PostScript code. .PP \&\f(CW$name\fR is a suitable name for the procset, created by appending the ids of the requested functions to \f(CW$basename\fR. If \f(CW$basename\fR is omitted, it defaults to the class name with \f(CW\*(C`::\*(C'\fR replaced by \f(CW\*(C`_\*(C'\fR. .PP \&\f(CW$code\fR is a block of PostScript code that defines the functions. It contains no comments or excess whitespace. .PP \&\f(CW$version\fR is the version number of the procset. .PP In scalar context, returns \f(CW$code\fR. .SH "DIAGNOSTICS" .IX Header "DIAGNOSTICS" .ie n .IP """%s is not an available function""" 4 .el .IP "\f(CW%s is not an available function\fR" 4 .IX Item "%s is not an available function" You requested a function that this version of PostScript::File::Functions doesn't provide. .SH "CONFIGURATION AND ENVIRONMENT" .IX Header "CONFIGURATION AND ENVIRONMENT" PostScript::File::Functions requires no configuration files or environment variables. .SH "INCOMPATIBILITIES" .IX Header "INCOMPATIBILITIES" None reported. .SH "BUGS AND LIMITATIONS" .IX Header "BUGS AND LIMITATIONS" No bugs have been reported. .SH "AUTHOR" .IX Header "AUTHOR" Christopher J. Madsen \f(CW\*(C`\*(C'\fR .PP Please report any bugs or feature requests to \f(CW\*(C`\*(C'\fR or through the web interface at . .PP You can follow or contribute to PostScript-File's development at . .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2015 by Christopher J. Madsen. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. .SH "DISCLAIMER OF WARRANTY" .IX Header "DISCLAIMER OF WARRANTY" \&\s-1BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE \*(L"AS IS\*(R" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.\s0 .PP \&\s-1IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE\s0 (\s-1INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE\s0), \s-1EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\s0