Consolidate license copies
[its.git] / sysdoc / xgp.writup
1 Copyright (c) 1999 Massachusetts Institute of Technology
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 3 of the License, or (at
6 your option) any later version.
7
8 This program is distributed in the hope that it will be useful, but
9 WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 ------------------------------
17
18 Character Mode for the XGP
19
20 The PDP-11 program for the XGP interprets character strings in files
21 in the following format:
22
23
24 Byte    Usual meaning                   Escape significance
25
26 0       Null - byte is ignored          Normal
27 1       Normal                          XGP ESCAPE 1
28 2       Normal                          XGP ESCAPE 2
29 3       Normal                          XGP ESCAPE 3
30 4       Normal                          XGP ESCAPE 4
31 5-7     Normal                          Reserved
32 10      Backspace                       Normal
33 11      TAB                             Normal
34 12      LF                              Normal
35 13      Normal                          Reserved
36 14      FF                              Normal
37 15      CR                              Normal
38 16-37   Normal                          Reserved
39 40-176  Normal                          Normal
40 177     ESCAPE                          Normal
41
42 Normal means the definition of this byte in  the current font will be
43 printed.  If this byte is  undefined in the current  font, it will be
44 ignored.
45
46 ESCAPE causes the next  byte to  have an  alternate meaning  selected
47 from the column "Escape significance".
48
49 Backspace  spaces to  the left the  width  of
50 one   space in the current font, including inter-character
51 spacing.
52
53 TAB produces  a column  select to  the column which  is at  least the
54 width  of a blank  to the right  of the current  column position, and
55 some multiple of 8 blank widths to the right of the left margin.
56 (this computation of the width includes the inter character spacing)
57
58 LF activates the current  text line. The current text  will be queued
59 to printed. This line will be printed at a vertical location such
60 that the distance between the baselines of of it and the preceeding line
61 is equal to the vertical spacing parameter, unless this would cause
62 the subscripts of the former line to overlap vertically with the superscripts
63 of this line.  It will then be pushed down to make this not the case.
64
65 FF, like  LF, activates  the text.   In  addition, FF  causes a  page
66 eject  after the  current text  line is  printed.   FF also  sets the
67 defalut Y position to the first line below the top of page  margin on
68 the new page.
69
70 The program will automatically form feed when the next text line would
71 place characters below the bottom margin.  Sequential form feeds will
72 increment the page number but will otherwise be ignored.
73
74 CR  causes  a  column  select  to  the  current  left  margin  to  be
75 generated.  This can be used to produce overprinting.
76
77
78 XGP ESCAPE  1 ('177&'001) causes  the next  7 bits  to be  read as  a
79 special operation code.  The following codes are implemented:
80
81         0-3     Font select.
82                 The code, 0 to 3 is taken as the font identification
83                 number of the font to use.
84
85         4-37    Reserved for future use.
86
87         40      XGP Column Selector
88                 The  next  14  bits  are taken  as  the
89                 x-position to print  at next.  (The  intention  is to
90                 allow arbitrary width spaces for text justification.)
91
92         41      XGP Underscore
93                 The next  7 bits are taken as the scan-line number on
94                 which to underscore.  It is taken as a 2's complement
95                 increment to the base line.  Zero is on the baseline,
96                 positive bytes are down from it.  Underscores outside
97                 the range of the other characters on the line will be
98                 ignored.   The  next 14 bits are taken as the length
99                 of the underscore.
100
101         42      Line space.
102                 This does  a line feed and then takes the byte as the
103                 number of lines between this line's baseline and the
104                 baeline of the following line.
105
106         43      Base-line adjust.
107                 The next  7 bits are taken in two's complement as the
108                 base-line adjustment  to  the  current  font.     The
109                 adjustment sticks  until  reset  by  another   adjust
110                 command or a font select. The intention is to allow a
111                 font to be  used  for  subscripts  and  superscripts.
112                 (Increment baseline  for  superscript,  decrement for
113                 subscript).  
114
115 **      44      Print the paper page number.
116                 The paper page number is set to 1 by a form feed.  It
117                 is  incremented  each  time  the  paper  is cut.  The
118                 decimal value of this count is printed.
119
120 **      45      Accept heading text.
121                 The next  byte  is a  count of bytes to follow. Those
122                 bytes  will be read into the heading line.  When that
123                 count is exhausted, the heading line will be printed.
124                 If a line feed or line space command  is  given  that
125                 would cause text to be printed below the current text
126                 area,  a  form  feed  is inserted by the XGP and if a 
127                 heading is defined, it will be printed.
128
129         46      Start Underline.
130                 Set the left end of an underline. See Stop Underline.
131
132         47      Stop Underline.
133                 The  next byte is the scan line on which to write the
134                 underline (same as XGP Underscore).   The  extent  of
135                 the underscore is defined by this command  and  Start
136                 Underline. If this command is not preceded by a Start
137                 Underline, it will underline from the left margin.
138                 Beware  of column selects.  No  underline  will  happen
139                 until this command is given.
140
141         50      Takes the next byte as the intercharacter spacing
142                 This is reset to zero at the end of each line.
143
144 XGP ESCAPE 2  ('177&'002) causes the next 7  bits to be taken  as the
145 column  increment.    This  quantity  is  signed: 0-77  are  positive
146 increments 100 to 177 are negative increments (100 \19 -100, 177 \19 -1).
147
148 XGP ESCAPE 3 ('177&'003) causes  the next 2 bytes to be  taken as the
149 scan line  number on which to  start this text line.   Scan line 0 is
150 the first  scan line  on the  page (immediately  following the  cut).
151 The topmost scanline  of the present text line will  be placed on the
152 scan  line indicated in this  command.  
153
154
155 **  XGP ESCAPE 4 ('177&'004).   This escape is used to  specify a vector.
156 It is followed by 11 bytes describing the vector:
157
158         2 bytes Y0      Scan line number of first line of vector.
159         2 bytes X0      Column  position of left  edge of first  line
160                         of the vector.
161         3 bytes DX      Delta X. 1 bit of sign; 11  bits  of integer;
162                         9 bits of fraction.
163         2 bytes N       The number of scan lines on which this vector
164                         is visible.
165         2 bytes W       The column width of each scan-line.
166
167 The  XGP   service  must   be  presented   with  vectors  sorted   by
168 ascendending  values  of Y0.   If  the  vectors are  not  sorted, the
169 output will be wrong.
170
171 The escape significance  of codes 5 through  10,  13, and  16 through
172 37 is not defined at the present time but reserved for future use.
173
174 $
175 \f\ 3\f