3bc685a004fb7eb2cdf871a4e696b89557f37651
[pspp-builds.git] / config / devices
1 # PSPP's standard output drivers.
2 #
3 # An introduction to the use of PSPP output drivers and this file
4 # follows.  However, refer to PSPP's Texinfo documentation for full
5 # information.
6 #
7 # Each output driver specification must be on a single line; however,
8 # lines may be spliced with a \ at the end of a line.  Line splicing
9 # is performed *before* comments (introduced by `#') are removed.
10 #
11 # Format is `DRIVERNAME:CLASSNAME:DEVICETYPE:OPTIONS'.
12 #
13 # DRIVERNAME is the name that identifies the driver to the user.  It
14 # is the name used on the -o command-line option.
15 #
16 # CLASSNAME is the internal name of the type of driver.  Device
17 # classes can be listed with `pspp -l'.
18 #
19 # DEVICETYPE identifies what type or types the devices is.  Zero or
20 # more of the following keywords may be given here: screen, printer,
21 # or listing.
22 #
23 # OPTIONS is a list of key/value pairs to pass to the driver.  Use
24 # spaces to separate pairs, and '=' to separate keys and values.
25 # Quotes " or ' can be used to delimit values that contain spaces.
26 # Example: paper-size="Envelope #10" charset=latin1
27 #
28 # Driver categories may be defined with lines of the form:
29 #
30 #   category=driver1 driver2 driver3 ... driverN
31 #
32 # To disable a driver, define a category with nothing on the right
33 # side.
34 #
35 # Macros may be defined with lines of the form:
36 #
37 #   define macro-name definition
38 #
39 # Macros may not be recursive; they may not take arguments.  (However,
40 # `definition' is macro-expanded *at time of definition*.)  Macros are
41 # referenced with $var or ${var} syntax; the latter is preferred.
42
43 # Preferred devices.
44 default=list-ascii
45 interactive=tty-ascii
46
47 # Output files.
48 define tty-output-file "|more"
49 define list-output-file "pspp.list"
50
51 # Generic ASCII devices
52 tty-ascii:ascii:screen:squeeze=on headers=off top-margin=0 bottom-margin=0 \
53   paginate=off length=auto width=auto output-file=${tty-output-file}
54 list-ascii:ascii:listing:length=66 width=79 output-file=${list-output-file}
55 raw-ascii:ascii:listing:width=9999 length=9999 output-file=${list-output-file} \
56   emphasis=none headers=off paginate=off squeeze=on \
57   top-margin=0 bottom-margin=0
58
59 # ASCII devices that support bold & underline via backspacing.
60 tty-ascii-bi:ascii:screen:output-file=${tty-output-file}
61 list-ascii-bi:ascii:listing:length=66 width=79 output-file=${list-output-file}
62
63 # VT100 graphics devices.
64 define vt100-graphics \
65   init='\033(B\033)0' \
66   box[1000]='\16q\17' box[1010]='\16q\17' box[0010]='\16q\17' \
67   box[0100]='\16x\17' box[0101]='\16x\17' box[0001]='\16x\17' \
68   box[0011]='\16j\17' box[1100]='\16l\17' box[0110]='\16k\17' \
69   box[1001]='\16m\17' box[1110]='\16w\17' box[1101]='\16t\17' \
70   box[0111]='\16u\17' box[1011]='\16v\17' box[1111]='\16n\17'
71
72 tty-vt100:ascii:screen:squeeze=on headers=off top-margin=0 bottom-margin=0 \
73   paginate=off output-file=${tty-output-file} ${vt100-graphics}
74 list-vt100:ascii:listing:length=66 width=79 output-file=${list-output-file} \
75   ${vt100-graphics}
76
77 # HTML device.
78 html:html::
79
80 # PostScript device.
81 list-ps:postscript::
82
83 # Cairo devices.
84 pdf:cairo:listing:
85 svg:cairo:listing:output-type=svg output-file="pspp.svg"
86 ps-cairo:cairo:listing:output-type=ps output-file="pspp-cairo.ps"
87
88 odt:odf:listing:debug=off output-file="pspp.odt"
89
90 # Devices that support the IBM PC line-drawing characters.
91 define ibmpc-graphics \
92   box[0000]='\x20' box[0001]='\xb3' box[0002]='\xba' \
93   box[0010]='\xc4' box[0011]='\xd9' box[0012]='\xbd' \
94   box[0020]='\xcd' box[0021]='\xbe' box[0022]='\xbc' \
95   box[0100]='\xb3' box[0101]='\xb3' box[0102]='\xc4' \
96   box[0110]='\xbf' box[0111]='\xb4' box[0112]='\xb6' \
97   box[0120]='\xb8' box[0121]='\xb5' box[0122]='\xb9' \
98   box[0200]='\xba' box[0201]='\xba' box[0202]='\xba' \
99   box[0210]='\xb7' box[0211]='\xb6' box[0212]='\xb6' \
100   box[0220]='\xbb' box[0221]='\xb9' box[0222]='\xb9' \
101   box[1000]='\xc4' box[1001]='\xc0' box[1002]='\xd3' \
102   box[1010]='\xc4' box[1011]='\xc1' box[1012]='\xd0' \
103   box[1020]='\xcd' box[1021]='\xcf' box[1022]='\xca' \
104   box[1100]='\xda' box[1101]='\xc3' box[1102]='\xc7' \
105   box[1110]='\xc2' box[1111]='\xc5' box[1112]='\xd7' \
106   box[1120]='\xd1' box[1121]='\xd8' box[1122]='\xce' \
107   box[1200]='\xd6' box[1201]='\xc7' box[1202]='\xc7' \
108   box[1210]='\xd2' box[1211]='\xd7' box[1212]='\xd7' \
109   box[1220]='\xca' box[1221]='\xce' box[1222]='\xce' \
110   box[2000]='\xcd' box[2001]='\xd4' box[2002]='\xc8' \
111   box[2010]='\xcd' box[2011]='\xcf' box[2012]='\xca' \
112   box[2020]='\xcd' box[2021]='\xcf' box[2022]='\xca' \
113   box[2100]='\xd5' box[2101]='\xc6' box[2102]='\xcc' \
114   box[2110]='\xd1' box[2111]='\xd8' box[2112]='\xce' \
115   box[2120]='\xd1' box[2121]='\xd8' box[2122]='\xce' \
116   box[2200]='\xc9' box[2201]='\xcc' box[2202]='\xcc' \
117   box[2210]='\xcb' box[2211]='\xce' box[2212]='\xce' \
118   box[2220]='\xcb' box[2221]='\xce' box[2222]='\xce'
119
120 tty-ibmpc:ascii:screen:length=$viewlength width=$viewwidth ${ibmpc-graphics} \
121   output-file=${tty-output-file}
122 list-ibmpc:ascii:listing:length=66 width=79 output-file=${list-output-file} \
123   ${ibmpc-graphics}
124
125 # Devices that support Unicode line-drawing characters in UTF-8 encoding.
126 # PSPP doesn't support a \u escape but if it did then this is how these
127 # would appear:
128 #
129 #     define utf8-graphics \
130 #       box[0000]='\u0020' box[1000]='\u2576' box[2000]='\u2550' \
131 #       box[0100]='\u2577' box[1100]='\u256D' box[2100]='\u2552' \
132 #       box[0200]='\u2551' box[1200]='\u2553' box[2200]='\u2554' \
133 #       box[0010]='\u2574' box[1010]='\u2500' box[2010]='\u2550' \
134 #       box[0110]='\u256E' box[1110]='\u252C' box[2110]='\u2564' \
135 #       box[0210]='\u2556' box[1210]='\u2565' box[2210]='\u2566' \
136 #       box[0020]='\u2550' box[1020]='\u2550' box[2020]='\u2550' \
137 #       box[0120]='\u2555' box[1120]='\u2564' box[2120]='\u2564' \
138 #       box[0220]='\u2557' box[1220]='\u2566' box[2220]='\u2566' \
139 #       box[0001]='\u2575' box[1001]='\u2570' box[2001]='\u2558' \
140 #       box[0101]='\u2502' box[1101]='\u251C' box[2101]='\u255E' \
141 #       box[0201]='\u2551' box[1201]='\u255F' box[2201]='\u2560' \
142 #       box[0011]='\u256F' box[1011]='\u2534' box[2011]='\u2567' \
143 #       box[0111]='\u2524' box[1111]='\u253C' box[2111]='\u256A' \
144 #       box[0211]='\u2562' box[1211]='\u256B' box[2211]='\u256C' \
145 #       box[0021]='\u255B' box[1021]='\u2567' box[2021]='\u2567' \
146 #       box[0121]='\u2561' box[1121]='\u256A' box[2121]='\u256A' \
147 #       box[0221]='\u2563' box[1221]='\u256C' box[2221]='\u256C' \
148 #       box[0002]='\u2551' box[1002]='\u2559' box[2002]='\u255A' \
149 #       box[0102]='\u2551' box[1102]='\u255F' box[2102]='\u2560' \
150 #       box[0202]='\u2551' box[1202]='\u255F' box[2202]='\u2560' \
151 #       box[0012]='\u255C' box[1012]='\u2568' box[2012]='\u2569' \
152 #       box[0112]='\u2562' box[1112]='\u256A' box[2112]='\u256C' \
153 #       box[0212]='\u2562' box[1212]='\u256B' box[2212]='\u256C' \
154 #       box[0022]='\u255D' box[1022]='\u2569' box[2022]='\u2569' \
155 #       box[0122]='\u2563' box[1122]='\u256C' box[2122]='\u256C' \
156 #       box[0222]='\u2563' box[1222]='\u256C' box[2222]='\u256C'
157 #
158 # Instead, we encode them in UTF-8 by hand below.
159 #
160 # Here is a little Perl program that I used to do this translation:
161 #
162 #     sub utf8_encode {
163 #         my $val = hex($_[0]);
164 #         my $d0 = 0xe0 | ($val >> 12);
165 #         my $d1 = 0x80 | (($val >> 6) & 0x3f);
166 #         my $d2 = 0x80 | ($val & 0x3f);
167 #         return sprintf('\x%02x\x%02x\x%02x', $d0, $d1, $d2);
168 #     }
169 #     while (<>) {
170 #         s/\\u(....)/utf8_encode($1)/ge;
171 #         print $_;
172 #     }
173 #
174 define utf8-graphics \
175   box[0000]='\xe0\x80\xa0' box[1000]='\xe2\x95\xb6' box[2000]='\xe2\x95\x90' \
176   box[0100]='\xe2\x95\xb7' box[1100]='\xe2\x95\xad' box[2100]='\xe2\x95\x92' \
177   box[0200]='\xe2\x95\x91' box[1200]='\xe2\x95\x93' box[2200]='\xe2\x95\x94' \
178   box[0010]='\xe2\x95\xb4' box[1010]='\xe2\x94\x80' box[2010]='\xe2\x95\x90' \
179   box[0110]='\xe2\x95\xae' box[1110]='\xe2\x94\xac' box[2110]='\xe2\x95\xa4' \
180   box[0210]='\xe2\x95\x96' box[1210]='\xe2\x95\xa5' box[2210]='\xe2\x95\xa6' \
181   box[0020]='\xe2\x95\x90' box[1020]='\xe2\x95\x90' box[2020]='\xe2\x95\x90' \
182   box[0120]='\xe2\x95\x95' box[1120]='\xe2\x95\xa4' box[2120]='\xe2\x95\xa4' \
183   box[0220]='\xe2\x95\x97' box[1220]='\xe2\x95\xa6' box[2220]='\xe2\x95\xa6' \
184   box[0001]='\xe2\x95\xb5' box[1001]='\xe2\x95\xb0' box[2001]='\xe2\x95\x98' \
185   box[0101]='\xe2\x94\x82' box[1101]='\xe2\x94\x9c' box[2101]='\xe2\x95\x9e' \
186   box[0201]='\xe2\x95\x91' box[1201]='\xe2\x95\x9f' box[2201]='\xe2\x95\xa0' \
187   box[0011]='\xe2\x95\xaf' box[1011]='\xe2\x94\xb4' box[2011]='\xe2\x95\xa7' \
188   box[0111]='\xe2\x94\xa4' box[1111]='\xe2\x94\xbc' box[2111]='\xe2\x95\xaa' \
189   box[0211]='\xe2\x95\xa2' box[1211]='\xe2\x95\xab' box[2211]='\xe2\x95\xac' \
190   box[0021]='\xe2\x95\x9b' box[1021]='\xe2\x95\xa7' box[2021]='\xe2\x95\xa7' \
191   box[0121]='\xe2\x95\xa1' box[1121]='\xe2\x95\xaa' box[2121]='\xe2\x95\xaa' \
192   box[0221]='\xe2\x95\xa3' box[1221]='\xe2\x95\xac' box[2221]='\xe2\x95\xac' \
193   box[0002]='\xe2\x95\x91' box[1002]='\xe2\x95\x99' box[2002]='\xe2\x95\x9a' \
194   box[0102]='\xe2\x95\x91' box[1102]='\xe2\x95\x9f' box[2102]='\xe2\x95\xa0' \
195   box[0202]='\xe2\x95\x91' box[1202]='\xe2\x95\x9f' box[2202]='\xe2\x95\xa0' \
196   box[0012]='\xe2\x95\x9c' box[1012]='\xe2\x95\xa8' box[2012]='\xe2\x95\xa9' \
197   box[0112]='\xe2\x95\xa2' box[1112]='\xe2\x95\xaa' box[2112]='\xe2\x95\xac' \
198   box[0212]='\xe2\x95\xa2' box[1212]='\xe2\x95\xab' box[2212]='\xe2\x95\xac' \
199   box[0022]='\xe2\x95\x9d' box[1022]='\xe2\x95\xa9' box[2022]='\xe2\x95\xa9' \
200   box[0122]='\xe2\x95\xa3' box[1122]='\xe2\x95\xac' box[2122]='\xe2\x95\xac' \
201   box[0222]='\xe2\x95\xa3' box[1222]='\xe2\x95\xac' box[2222]='\xe2\x95\xac'
202
203 tty-utf8:ascii:screen:length=$viewlength width=$viewwidth ${utf8-graphics} \
204   output-file=${tty-output-file} emphasis=none
205 list-utf8:ascii:listing:length=66 width=79 output-file=${list-output-file} \
206   ${utf8-graphics} emphasis=none
207
208 # Local Variables:
209 # fill-prefix: "# "
210 # End: