|
1 week ago | |
---|---|---|
examples | 3 years ago | |
COPYING | 11 years ago | |
COPYING.LESSER | 11 years ago | |
LICENSE | 11 years ago | |
README.org | 1 week ago | |
README.txt | 3 years ago | |
TODO.org | 3 years ago | |
cffi-interface.lisp | 3 years ago | |
cl-pslib.asd | 3 years ago | |
cl-pslib.lisp | 3 years ago | |
conditions.lisp | 6 years ago | |
constants.lisp | 3 years ago | |
graphics-utils.lisp | 3 years ago | |
package.lisp | 3 years ago | |
page-metrics.lisp | 3 years ago | |
pslib.i | 11 years ago | |
pslib.lisp | 11 years ago | |
shapes.lisp | 3 years ago |
http://quickdocs.org/badge/cl-pslib.svg
The 'ps' nickname for this package has been removed.
This means that if you are using this library you should replace all occurences of the 'ps' package qualifier with 'cl-pslib'.
Examples
from:
#+BEGIN_SRC common-lisp (ps:get-value doc "boxheight") #+END_SRC
to:
#+BEGIN_SRC common-lisp (cl-pslib:get-value doc "boxheight") #+END_SRC
and from:
#+BEGIN_SRC common-lisp (defpackage :foo (:use :ps)) #+END_SRC
to:
#+BEGIN_SRC common-lisp (defpackage :foo (:use :cl-pslib)) #+END_SRC
Alternatively., if you are using ECL, ABCL, CCL or SBCL compiler you can setup a package local nickname as showed here.
Cl-pslib is a (thin) wrapper around pslib a library for generating PostScript files.
Cl-pslib use CFFI and SWIG to interface with foreign (non lisp) library and generate the low-level lisp wrapper respectively.
cl-pslib does not export the raw (CFFI) pslib API but use CLOS instead.
A psdoc C struct pointer is wrapped in the class psdoc, most of the functions to manipulate this pointer are wrapped in lisp methods specialized for that class.
Pslib use a lot of parameters to configure its behavior.
Example:
(get-value doc "boxheight")
I found this very unpractical so i tried to generate lisp constants to match the corresponding string parameter
(get-value doc +value-key-boxheight+)
As general rule the methods for the class psdoc are the same of the ones of the pslib with the character "_" substituted by "-".
There are some exceptions listed below.
native name | lisp name |
---|---|
PS_set_border_color |
set-border-link-color |
PS_set_border_dash |
set-border-link-dash |
PS_set_border_style |
set-border-link-style |
PS_open, PS_open_mem |
open-doc |
PS_fill |
fill-path |
PS_show and PS_show2 |
show |
PS_show_xy and PS_show_xy2 |
show-xy |
PS_string_geometry , PS_stringwidth and PS_stringwidth2 |
string-geometry |
PS_symbol |
font-symbol |
PS_symbol_name |
font-symbol-name |
PS_symbol_width |
font-symbol-width |
setcolor
can accept a cl-color
object as parameter;psdoc
is created theopen-doc
method will pass the output of pslib (i.e.the PostScriptThere is another callback: write-to-stream
that write the postscript code to a stream
(by default the stream is bound to *standard-output*
)
#+BEGIN_SRC common-lisp (let* ((cl-pslib:*callback-stream* standard-output) (doc (make-instance 'cl-pslib:psdoc :writeproc (cffi:callback write-to-stream)))) ;; rest of the code here )
#+END_SRC
string-geometry
method return an instance of text-metrics
classNote that the whole library is in an alpha stage, testing is still in progress, please see section below
begin-template
and and-template
The high-level API does not still remap this functions:
PS_setdash
(use set-polydash
instead).Please file bug report on the issue tracker
This library is released under Lisp Lesser General Public license (see COPYING.LESSER file)
Examples are released under GPL version 3 or later
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.