| 1 |
greg |
1.2 |
.\" RCSid "$Id$"
|
| 2 |
greg |
1.1 |
.TH META 3 11/15/93 Radiance
|
| 3 |
|
|
.SH NAME
|
| 4 |
|
|
libmeta.a - simplified interface to metafile(5)
|
| 5 |
|
|
.SH SYNOPSIS
|
| 6 |
|
|
.B extern FILE *pout;
|
| 7 |
|
|
.PP
|
| 8 |
|
|
.B mline(x, y, type, thick, color)
|
| 9 |
|
|
.PP
|
| 10 |
|
|
.B mpoly(x, y, border, pat, color)
|
| 11 |
|
|
.PP
|
| 12 |
|
|
.B mdraw(x, y)
|
| 13 |
|
|
.PP
|
| 14 |
|
|
.B mtext(x, y, s, cpi, color)
|
| 15 |
|
|
.br
|
| 16 |
|
|
.B char *s;
|
| 17 |
|
|
.PP
|
| 18 |
|
|
mvstr(xmin, ymin, xmax, ymax, s, d, thick, color)
|
| 19 |
|
|
.br
|
| 20 |
|
|
.B char *s;
|
| 21 |
|
|
.PP
|
| 22 |
|
|
mrectangle(xmin, ymin, xmax, ymax, pat, color)
|
| 23 |
|
|
.PP
|
| 24 |
|
|
mtriangle(xmin, ymin, xmax, ymax, d, pat, color)
|
| 25 |
|
|
.PP
|
| 26 |
|
|
msegment(xmin, ymin, xmax, ymax, sname, d, thick, color)
|
| 27 |
|
|
.br
|
| 28 |
|
|
.B char *sname;
|
| 29 |
|
|
.PP
|
| 30 |
|
|
.B msetpat(pat, pattern)
|
| 31 |
|
|
.br
|
| 32 |
|
|
.B char *pattern;
|
| 33 |
|
|
.PP
|
| 34 |
|
|
.B mopenseg(sname)
|
| 35 |
|
|
.br
|
| 36 |
|
|
.B char *sname;
|
| 37 |
|
|
.PP
|
| 38 |
|
|
.B mcloseseg()
|
| 39 |
|
|
.PP
|
| 40 |
|
|
.B minclude(fname)
|
| 41 |
|
|
.br
|
| 42 |
|
|
.B char *fname;
|
| 43 |
|
|
.PP
|
| 44 |
|
|
.B mendpage()
|
| 45 |
|
|
.PP
|
| 46 |
|
|
.B mdone()
|
| 47 |
|
|
.SH DESCRIPTION
|
| 48 |
|
|
The routines in
|
| 49 |
|
|
.I libmeta
|
| 50 |
|
|
provide a simple interface to the metafile(5) 2D graphics stream.
|
| 51 |
|
|
Output from these routines is sent to
|
| 52 |
|
|
.I pout.
|
| 53 |
|
|
.I Pout
|
| 54 |
|
|
defaults to the standard output,
|
| 55 |
|
|
and should be piped to the appropriate device driver.
|
| 56 |
|
|
.PP
|
| 57 |
|
|
All coordinates range from 0 to 16383 and map to a square area on
|
| 58 |
|
|
the output device.
|
| 59 |
|
|
.I D
|
| 60 |
|
|
values are one of 'r', 'u', 'l' and 'd' corresponding to right,
|
| 61 |
|
|
up, left, and down respectively.
|
| 62 |
|
|
.I Color
|
| 63 |
|
|
values range from 0 to 3 and normally correspond to black,
|
| 64 |
|
|
cyan, green and blue.
|
| 65 |
|
|
.I Pattern
|
| 66 |
|
|
values range from 0 to 3 and default to solid, thick lines,
|
| 67 |
|
|
thin lines, and candystripe.
|
| 68 |
|
|
Pattern value mapping may be changed via
|
| 69 |
|
|
.I setpat.
|
| 70 |
|
|
All strings are null-terminated, and do not contain newlines.
|
| 71 |
|
|
.PP
|
| 72 |
|
|
.I Mline
|
| 73 |
|
|
starts a line at the given coordinates.
|
| 74 |
|
|
The line
|
| 75 |
|
|
.I type
|
| 76 |
|
|
is a number from 0 to 3 corresponding to solid, dashed, dotted,
|
| 77 |
|
|
and dot-dashed.
|
| 78 |
|
|
The line thickness,
|
| 79 |
|
|
.I thick,
|
| 80 |
|
|
is a number from 0 to 3.
|
| 81 |
|
|
Connected lines are drawn with successive calls to
|
| 82 |
|
|
.I mdraw.
|
| 83 |
|
|
.PP
|
| 84 |
|
|
.I Mpoly
|
| 85 |
|
|
starts a polygon at the given coordinates.
|
| 86 |
|
|
The boolean
|
| 87 |
|
|
.I border
|
| 88 |
|
|
specifies whether or not a border is desired around the polygon.
|
| 89 |
|
|
.I Mdraw
|
| 90 |
|
|
is used to add vertices to the polygon.
|
| 91 |
|
|
The polygon will be closed automatically after the last call.
|
| 92 |
|
|
.PP
|
| 93 |
|
|
.I Mtext
|
| 94 |
|
|
prints a string of hardware characters starting at the given
|
| 95 |
|
|
coordinates.
|
| 96 |
|
|
The characters per inch are
|
| 97 |
|
|
.I cpi.
|
| 98 |
|
|
Text is always oriented to the right.
|
| 99 |
|
|
.PP
|
| 100 |
|
|
.I Mvstr
|
| 101 |
|
|
places a vector character string within the given boundaries.
|
| 102 |
|
|
The string is oriented according to
|
| 103 |
|
|
.I d.
|
| 104 |
|
|
The character line thickness is given by
|
| 105 |
|
|
.I thick.
|
| 106 |
|
|
.PP
|
| 107 |
|
|
.I Mrectangle
|
| 108 |
|
|
fills the given box with
|
| 109 |
|
|
.I pat.
|
| 110 |
|
|
.I Mtriangle
|
| 111 |
|
|
fills the half-box with orientation
|
| 112 |
|
|
.I d
|
| 113 |
|
|
in the given boundaries.
|
| 114 |
|
|
Right corresponds to a triangle in the lower right half of the
|
| 115 |
|
|
box.
|
| 116 |
|
|
Up corresponds to a triangle in the upper right, left is upper
|
| 117 |
|
|
left, and down is lower left.
|
| 118 |
|
|
.PP
|
| 119 |
|
|
.I Msegment
|
| 120 |
|
|
places an instance of the segment
|
| 121 |
|
|
.I sname
|
| 122 |
|
|
within the given boundaries.
|
| 123 |
|
|
The segment is oriented according to
|
| 124 |
|
|
.I d,
|
| 125 |
|
|
where 'r' is null rotation.
|
| 126 |
|
|
If either
|
| 127 |
|
|
.I thick
|
| 128 |
|
|
or
|
| 129 |
|
|
.I color
|
| 130 |
|
|
is nonzero,
|
| 131 |
|
|
its value will replace corresponding values in the segment
|
| 132 |
|
|
primitives. (For area filling, thick changes the fill pattern.)
|
| 133 |
|
|
.PP
|
| 134 |
|
|
.I Msetpat
|
| 135 |
|
|
maps
|
| 136 |
|
|
.I pat
|
| 137 |
|
|
to
|
| 138 |
|
|
.I pattern.
|
| 139 |
|
|
.I Pattern
|
| 140 |
|
|
is a string of the form "Pn" where n is a number between 0 and 11.
|
| 141 |
|
|
.PP
|
| 142 |
|
|
.I Mopenseg
|
| 143 |
|
|
opens the segment named
|
| 144 |
|
|
.I sname.
|
| 145 |
|
|
All graphics calls up to a matching call to
|
| 146 |
|
|
.I mcloseseg
|
| 147 |
|
|
are stored under
|
| 148 |
|
|
.I sname.
|
| 149 |
|
|
An instance of the segment is obtained with a call to
|
| 150 |
|
|
.I msegment.
|
| 151 |
|
|
Segments can be nested to any level, and redefining segments
|
| 152 |
|
|
is allowed.
|
| 153 |
|
|
Beware of calls to
|
| 154 |
|
|
.I mtext
|
| 155 |
|
|
within a segment, since text will not rotate or scale.
|
| 156 |
|
|
.PP
|
| 157 |
|
|
.I Minclude
|
| 158 |
|
|
includes the graphics metafile
|
| 159 |
|
|
.I fname
|
| 160 |
|
|
in the output stream.
|
| 161 |
|
|
.I Mendpage
|
| 162 |
|
|
advances to the next screen or page.
|
| 163 |
|
|
On a terminal, the bell rings and a line is read to prevent
|
| 164 |
|
|
premature erasure.
|
| 165 |
|
|
.I Mdone
|
| 166 |
|
|
completes metafile output, and is the only required call.
|
| 167 |
|
|
.SH DIAGNOSTICS
|
| 168 |
|
|
None.
|
| 169 |
|
|
.SH SEE ALSO
|
| 170 |
|
|
t4014(1), mx80(1), impress(1), primout(3), metafile(5)
|