2 '\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
4 '\" See the file "license.terms" for information on usage and redistribution
5 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
10 .TH Tk_CanvasPs 3 4.0 Tk "Tk Library Procedures"
13 Tk_CanvasPsY, Tk_CanvasPsBitmap, Tk_CanvasPsColor, Tk_CanvasPsFont, Tk_CanvasPsPath, Tk_CanvasPsStipple \- utility procedures for generating Postscript for canvases
19 \fBTk_CanvasPsY\fR(\fIcanvas, canvasY\fR)
22 \fBTk_CanvasPsBitmap\fR(\fIinterp, canvas, bitmap, x, y, width, height\fR)
25 \fBTk_CanvasPsColor\fR(\fIinterp, canvas, colorPtr\fR)
28 \fBTk_CanvasPsFont\fR(\fIinterp, canvas, tkFont\fR)
30 \fBTk_CanvasPsPath\fR(\fIinterp, canvas, coordPtr, numPoints\fR)
33 \fBTk_CanvasPsStipple\fR(\fIinterp, canvas, bitmap\fR)
35 .AS "unsigned int" "numPoints"
36 .AP Tk_Canvas canvas in
37 A token that identifies a canvas widget for which Postscript is
40 Y-coordinate in the space of the canvas.
41 .AP Tcl_Interp *interp in/out
42 A Tcl interpreter; Postscript is appended to its result, or the
43 result may be replaced with an error message.
45 Bitmap to use for generating Postscript.
47 X-coordinate within \fIbitmap\fR of left edge of region to output.
49 Y-coordinate within \fIbitmap\fR of top edge of region to output.
51 Width of region of bitmap to output, in pixels.
53 Height of region of bitmap to output, in pixels.
54 .AP XColor *colorPtr in
55 Information about color value to set in Postscript.
57 Font for which Postscript is to be generated.
58 .AP double *coordPtr in
59 Pointer to an array of coordinates for one or more
60 points specified in canvas coordinates.
61 The order of values in \fIcoordPtr\fR is x1, y1, x2, y2, x3, y3,
64 Number of points at \fIcoordPtr\fR.
69 These procedures are called by canvas type managers to carry out
70 common functions related to generating Postscript.
71 Most of the procedures take a \fIcanvas\fR argument, which
72 refers to a canvas widget for which Postscript is being
75 \fBTk_CanvasPsY\fR takes as argument a y-coordinate in the space of
76 a canvas and returns the value that should be used for that point
77 in the Postscript currently being generated for \fIcanvas\fR.
78 Y coordinates require transformation because Postscript uses an
79 origin at the lower-left corner whereas X uses an origin at the
81 Canvas x coordinates can be used directly in Postscript without
84 \fBTk_CanvasPsBitmap\fR generates Postscript to describe a region
86 The Postscript is generated in proper image data format for Postscript,
87 i.e., as data between angle brackets, one bit per pixel.
88 The Postscript is appended to \fIinterp->result\fR and TCL_OK is returned
89 unless an error occurs, in which case TCL_ERROR is returned and
90 \fIinterp->result\fR is overwritten with an error message.
92 \fBTk_CanvasPsColor\fR generates Postscript to set the current color
93 to correspond to its \fIcolorPtr\fR argument, taking into account any
94 color map specified in the \fBpostscript\fR command.
95 It appends the Postscript to \fIinterp->result\fR and returns
96 TCL_OK unless an error occurs, in which case TCL_ERROR is returned and
97 \fIinterp->result\fR is overwritten with an error message.
99 \fBTk_CanvasPsFont\fR generates Postscript that sets the current font
100 to match \fItkFont\fR as closely as possible.
101 \fBTk_CanvasPsFont\fR takes into account any font map specified
102 in the \fBpostscript\fR command, and it does
103 the best it can at mapping X fonts to Postscript fonts.
104 It appends the Postscript to \fIinterp->result\fR and returns TCL_OK
105 unless an error occurs, in which case TCL_ERROR is returned and
106 \fIinterp->result\fR is overwritten with an error message.
108 \fBTk_CanvasPsPath\fR generates Postscript to set the current path
109 to the set of points given by \fIcoordPtr\fR and \fInumPoints\fR.
110 It appends the resulting Postscript to \fIinterp->result\fR.
112 \fBTk_CanvasPsStipple\fR generates Postscript that will fill the
113 current path in stippled fashion.
114 It uses \fIbitmap\fR as the stipple pattern and the current Postscript
115 color; ones in the stipple bitmap are drawn in the current color, and
116 zeroes are not drawn at all.
117 The Postscript is appended to \fIinterp->result\fR and TCL_OK is
118 returned, unless an error occurs, in which case TCL_ERROR is returned and
119 \fIinterp->result\fR is overwritten with an error message.
122 bitmap, canvas, color, font, path, Postscript, stipple