386BSD 0.1 development
[unix-history] / usr / othersrc / public / ghostscript-2.4.1 / lib.doc
CommitLineData
31a39745
WJ
1 Copyright (C) 1989 Aladdin Enterprises. All rights reserved.
2 Distributed by Free Software Foundation, Inc.
3
4This file is part of Ghostscript.
5
6Ghostscript is distributed in the hope that it will be useful, but
7WITHOUT ANY WARRANTY. No author or distributor accepts responsibility
8to anyone for the consequences of using it or for whether it serves any
9particular purpose or works at all, unless he says so in writing. Refer
10to the Ghostscript General Public License for full details.
11
12Everyone is granted permission to copy, modify and redistribute
13Ghostscript, but only under the conditions described in the Ghostscript
14General Public License. A copy of this license is supposed to have been
15given to you along with Ghostscript so you can know your rights and
16responsibilities. It should be in a file named COPYING. Among other
17things, the copyright notice and this notice must be preserved on all
18copies.
19
20- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
21
22This file, lib.doc, describes the Ghostscript library, a collection of C
23procedures that implement the primitive graphic operations of the
24Ghostscript language.
25
26For an overview of Ghostscript and a list of the documentation files, see
27README.
28
29********
30******** The Ghostscript library ********
31********
32
33Ghostscript is actually two programs: a language interpreter, and a
34graphics library. The library provides, in the form of C procedures, all
35the graphics functions of the language, i.e., approximately those
36facilities listed in section 6.2 of the PostScript manual starting with
37the graphics state operators. In addition, the library provides some
38lower-level graphics facilities that offer higher performance in exchange
39for less generality.
40
41To be specific, the highest level of the library implements all the
42operators in the "graphics state", "coordinate system and matrix", "path
43construction", "painting", "character and font", and "font cache" sections
44of the PostScript manual, with the following deliberate exceptions:
45 settransfer, currenttransfer
46 definefont, findfont
47 FontDirectory, StandardEncoding
48The following "device" operators are implemented:
49 showpage (synchronizes the display)
50 nulldevice
51
52There are slight differences in the operators that return multiple values,
53since C's provisions for this are awkward. Also, the control structure
54for the operators involving (an) auxiliary procedure(s) (setscreen,
55pathforall, image, imagemask) is partly inverted: the client calls a
56procedure to set up an enumerator object, and then calls another procedure
57for each iteration. The ...show operators, charpath, and stringwidth
58also use an inverted control structure.
59
60Files named gs*.c implement the higher level of the graphics library.
61To use the facilities of gs?.c, a client program should include
62gs?.h. As might be expected, all procedures, variables, and
63structures available at this level begin with gs_. Structures that
64appear in these interfaces, but whose definitions may be hidden from
65clients, also have names beginning with gs_, i.e., the prefix
66reflects at what level the abstraction is made available, not the
67implementation.
68
69Files named gx*.c implement the lower level of the graphics library.
70To use the facilities of gx?.c, a client program should include
71gx?.h. The interfaces at the gx level are less stable, and expose
72more of the implementation detail, than those at the gs level: in
73particular, the gx interfaces generally use device coordinates in an
74internal fixed-point representation, as opposed to the gs interfaces
75that use floating point user coordinates. Named entities at this
76level begin with gx_.
77
78Files named gz*.c and gz*.h are internal to the Ghostscript
79implementation, and not designed to be called by clients.