1 /* Hello, Emacs, this is -*-C-*-
2 * $Id: hpgl.trm,v 1.22.2.1 2009/03/02 23:57:54 sfeam Exp $
5 /* GNUPLOT - hpgl.trm */
8 * Copyright 1990 - 1993, 1998, 2004
10 * Permission to use, copy, and distribute this software and its
11 * documentation for any purpose with or without fee is hereby granted,
12 * provided that the above copyright notice appear in all copies and
13 * that both that copyright notice and this permission notice appear
14 * in supporting documentation.
16 * Permission to modify the software is granted, but not the right to
17 * distribute the complete modified source code. Modifications are to
18 * be distributed as patches to the released version. Permission to
19 * distribute binaries produced by compiling modified sources is granted,
21 * 1. distribute the corresponding source modifications from the
22 * released version in the form of a patch file along with the binaries,
23 * 2. add special version identification to distinguish your version
24 * in addition to the base release version number,
25 * 3. provide your name and address as the primary contact for the
26 * support of your modified version, and
27 * 4. retain our contact information in regard to use of the base
29 * Permission to distribute the released version of the source code along
30 * with corresponding source modifications in the form of a patch file is
31 * granted with same provisions 2 through 4 for binary distributions.
33 * This software is provided "as is" without express or implied warranty
34 * to the extent permitted by applicable law.
38 * This file is included by ../term.h.
40 * This terminal driver supports:
41 * hpgl, hp7550, hp7580b, HP Laserjet III
42 * hp7550 has been replaced by "hpgl 8 eject"
43 * hp7580b has been replaced by "hpgl 4"
46 * Colin Kelley, Thomas Williams, Russell Lang
48 * send your comments or suggestions to (gnuplot-info@lists.sourceforge.net).
54 * MODIFIED for expanded HPGL/2 and PCL utilites
55 * Tom Swiler (tom@silica.mse.ufl.edu)
56 * Modified June 1995 Ian MacPhedran to support newterm format
57 * Modified October 1995 Ian MacPhedran to simplify HPGL terminals
58 * Modified January 96 by David Denholm and Emmanuel Bigler for cp850
59 * and iso international character sets
60 * Modified February 99 by Jeremy Brenes to give PCL5 terminal optional
61 * multi-pen support (6 pen default), a default 34" plotting width for
62 * use with large color plotters such as the HP Designjet 750C,
63 * various alternative plot sizes, and variable fontsizes;
64 * Also decreased the HPGL terminal's fixed fontsize to make it more
65 * reasonable when plots get scaled to 34"
66 * Modified July 99 by Jeremy Brenes to make extended plot area smaller;
67 * added solid/dashed lines option, additional font types, mixed fonts
68 * Modified November 99 by Jeremy Brenes to add a postscript pointtypes
69 * option, special purpose negative pointtypes, and a pointsize function
80 #endif /* TERM_REGISTER */
83 TERM_PUBLIC void HPGL_options __PROTO((void));
84 TERM_PUBLIC void HPGL2_options __PROTO((void));
85 TERM_PUBLIC void PCL_options __PROTO((void));
86 TERM_PUBLIC void HPGL_init __PROTO((void));
87 /* TERM_PUBLIC void HPGL2_init __PROTO((void)); */
88 TERM_PUBLIC void PCL_init __PROTO((void));
89 TERM_PUBLIC void HPGL_graphics __PROTO((void));
90 TERM_PUBLIC void HPGL2_graphics __PROTO((void));
91 TERM_PUBLIC void PCL_graphics __PROTO((void));
92 TERM_PUBLIC void HPGL_text __PROTO((void));
93 /* TERM_PUBLIC void HPGL2_text __PROTO((void)); */
94 TERM_PUBLIC void PCL_text __PROTO((void));
95 TERM_PUBLIC void HPGL_linetype __PROTO((int linetype));
96 TERM_PUBLIC void HPGL2_linetype __PROTO((int linetype));
97 TERM_PUBLIC void HPGL_put_text __PROTO((unsigned int x, unsigned int y, const char *str));
98 TERM_PUBLIC void HPGL2_put_text __PROTO((unsigned int x, unsigned int y, const char *str));
99 TERM_PUBLIC void HPGL_move __PROTO((unsigned int x, unsigned int y));
100 TERM_PUBLIC void HPGL_vector __PROTO((unsigned int x, unsigned int y));
101 TERM_PUBLIC void HPGL2_move __PROTO((unsigned int x, unsigned int y));
102 TERM_PUBLIC void HPGL2_vector __PROTO((unsigned int x, unsigned int y));
103 TERM_PUBLIC void HPGL2_encode __PROTO((int d));
104 TERM_PUBLIC int HPGL_text_angle __PROTO((int ang));
105 TERM_PUBLIC int HPGL2_text_angle __PROTO((int ang));
106 TERM_PUBLIC void HPGL_reset __PROTO((void));
107 /* TERM_PUBLIC void HPGL2_reset __PROTO((void)); */
108 TERM_PUBLIC void PCL_reset __PROTO((void));
109 TERM_PUBLIC int HPGL2_justify_text __PROTO((enum JUSTIFY just));
110 TERM_PUBLIC int HPGL2_set_font __PROTO((const char *font));
111 TERM_PUBLIC void HPGL2_point __PROTO((unsigned int x, unsigned int y, int number));
112 TERM_PUBLIC void HPGL2_neg_point __PROTO((unsigned int x, unsigned int y, int number));
113 TERM_PUBLIC void HPGL2_pointsize __PROTO((double size));
114 #define GOT_HPGL_PROTO
115 #endif /* TERM_PROTO */
117 #ifndef TERM_PROTO_ONLY
120 * The maximum plot size, in plotter units.
121 * Note that the actual size of larger plots may be limited by
122 * available printer memory.
125 #define HPGL_PUPI 1016 /* Plotter units per inch */
127 #define HPGL_XMAX_A 10000
128 #define HPGL_YMAX_A 7500
130 #define HPGL_XMAX_B 13000
131 #define HPGL_YMAX_B 7500
133 #define HPGL_XMAX_C 45333
134 #define HPGL_YMAX_C 34000
136 #define HPGL_XMAX_D 52000
137 #define HPGL_YMAX_D 34000
139 #define HPGL_XMAX HPGL_XMAX_A
140 #define HPGL_YMAX HPGL_YMAX_A
142 #define PCL_XMAX HPGL_XMAX_C
143 #define PCL_YMAX (HPGL_YMAX_C-60)
149 #define HPGL_VTIC (HPGL_YMAX/70)
150 #define HPGL_HTIC (HPGL_YMAX/70)
152 #define PCL_VTIC ((HPGL_YMAX_C-60)/320)
153 #define PCL_HTIC ((HPGL_YMAX_C-60)/320)
159 #define HPGL_VCHAR (HPGL_YMAX/100*8/10) /* 0.8% */
160 #define HPGL_HCHAR (HPGL_XMAX/100*3/10) /* 0.3% */
163 * Font size for HPGL/2
166 #define HPGL2_DEF_POINT 12 /* Height of font */
168 #define HPGL2_DEF_PITCH (3 * 72 / (HPGL2_DEF_POINT * 2))
169 #define HPGL2_VCHAR ((int) HPGL_PUPI * HPGL2_DEF_POINT / 72)
170 #define HPGL2_HCHAR (HPGL2_VCHAR * 2 / 3)
173 * Point size for HPGL/2
176 static double HPGL2_psize = 1.0; /* Default point size */
179 * Number of available pointtypes for HPGL/2
182 #define HPGL2_NUM_NOPSPOINTS 6; /* for nopspoints option */
183 #define HPGL2_NUM_PSPOINTS 75; /* for pspoints option */
189 #define DOWN 0 /* Pen is down */
190 #define UP 1 /* Pen is up */
191 #define UNKNOWN -10 /* Unknown status for lots of things */
194 * For Polyline Encoded, either use base 64 or base 32.
195 * Save space with base 64, but get 8-bit characters.
198 #define HPGL2_BASE64 1
202 #define HPGL2_LOW_OFFS 63
203 #define HPGL2_HIGH_OFFS 191
204 #define HPGL2_MASK 63
207 #define HPGL2_LOW_OFFS 63
208 #define HPGL2_HIGH_OFFS 95
209 #define HPGL2_MASK 31
213 * Data structures for options
216 struct HPGL2_font_str {
217 const char *compare, *name;
218 int symbol_set, spacing;
219 double pitch, height;
220 int posture, stroke_weight, typeface;
223 struct PCL_mode_str {
224 const char *compare, *name, *command;
225 unsigned int xmax, ymax;
229 * The default font goes first. Although it is the ugliest, the
230 * stick font is probably supported by the most devices.
233 static struct HPGL2_font_str GPFAR HPGL2_font_table[] = {
234 {"u$nivers", "univers", 277, 1, 0.0, HPGL2_DEF_POINT, 0, 0, 4148},
235 {"s$tick", "stick", 277, 0, HPGL2_DEF_PITCH, 0.0, 0, 0, 48},
236 {"cg_t$imes", "cg_times", 277, 1, 0.0, HPGL2_DEF_POINT, 0, 0, 4101},
237 {"z$apf_dingbats", "zapf_dingbats", 364, 1, 0.0, HPGL2_DEF_POINT, 0, 0, 4141},
238 {"an$tique_olive", "antique_olive", 277, 1, 0.0, HPGL2_DEF_POINT, 0, 0, 4168},
239 {"ar$ial", "arial", 277, 1, 0.0, HPGL2_DEF_POINT, 0, 0, 16602},
240 {"cou$rier", "courier", 277, 1, 0.0, HPGL2_DEF_POINT, 0, 0, 4099},
241 {"g$aramond_antigua", "garamond_antigua", 277, 1, 0.0, HPGL2_DEF_POINT, 0, 0, 4197},
242 {"l$etter_gothic", "letter_gothic", 277, 1, 0.0, HPGL2_DEF_POINT, 0, 0, 4102},
243 {"cg_o$mega", "cg_omega", 277, 1, 0.0, HPGL2_DEF_POINT, 0, 0, 4113},
244 {"al$bertus", "albertus", 277, 1, 0.0, HPGL2_DEF_POINT, 0, 1, 4362},
245 {"ti$mes_new_roman", "times_new_roman", 277, 1, 0.0, HPGL2_DEF_POINT, 0, 0, 16901},
246 {"cl$arendon", "clarendon", 277, 1, 0.0, HPGL2_DEF_POINT, 4, 3, 4140},
247 {"cor$onet", "coronet", 277, 1, 0.0, HPGL2_DEF_POINT, 1, 0, 4116},
248 {"m$arigold", "marigold", 277, 1, 0.0, HPGL2_DEF_POINT, 0, 0, 4297},
249 {"tr$uetype_symbols", "truetype_symbols", 621, 1, 0.0, HPGL2_DEF_POINT, 0, 0, 16686},
250 {"w$ingdings", "wingdings", 18540, 1, 0.0, HPGL2_DEF_POINT, 1, 0, 31402}
253 #define HPGL2_FONTS (sizeof(HPGL2_font_table) / sizeof (struct HPGL2_font_str))
254 static struct HPGL2_font_str *HPGL2_font = &HPGL2_font_table[0];
257 * The default mode goes first. Landscape style plots are probably the
258 * most compatable with other HPGL devices.
261 static struct PCL_mode_str GPFAR PCL_mode_table[] = {
262 {"l$andscape", "landscape", "\033&l1O", PCL_XMAX, PCL_YMAX},
263 {"p$ortrait", "portrait", "\033&l0O", PCL_YMAX, PCL_XMAX}
266 #define PCL_MODES (sizeof(PCL_mode_table) / sizeof (struct PCL_mode_str))
267 static struct PCL_mode_str *PCL_mode = &PCL_mode_table[0];
270 * Various line types and widths to distinguish data sets in monochrome
273 static const char *HPGL2_lt[] = { "", ",2", ",2", ",2", ",2", ",2", ",2", ",2" },
274 *HPGL2_pw[] = { ".24", ".16", ".08"};
276 #define HPGL2_LINETYPES (sizeof(HPGL2_lt) / sizeof(char *))
277 #define HPGL2_PENWIDTHS (sizeof(HPGL2_pw) / sizeof(char *))
279 /* encoding vector for cp850 , characters 128 (0200) -> 255 (0377) */
281 static char hpgl_cp_850[128][4] = {
283 /* 0200 */ "\0164\017",
284 /* 0201 */ "\016O\017",
285 /* 0202 */ "\016E\017",
286 /* 0203 */ "\016@\017",
287 /* 0204 */ "\016L\017",
288 /* 0205 */ "\016H\017",
289 /* 0206 */ "\016T\017",
290 /* 0207 */ "\0165\017",
292 /* 0210 */ "\016A\017",
293 /* 0211 */ "\016M\017",
294 /* 0212 */ "\016I\017",
295 /* 0213 */ "\016]\017",
296 /* 0214 */ "\016Q\017",
297 /* 0215 */ "\016Y\017",
298 /* 0216 */ "\016X\017",
299 /* 0217 */ "\016P\017",
301 /* 0220 */ "\016\134\017",
302 /* 0221 */ "\016W\017",
303 /* 0222 */ "\016S\017",
304 /* 0223 */ "\016B\017",
305 /* 0224 */ "\016N\017",
306 /* 0225 */ "\016J\017",
307 /* 0226 */ "\016C\017",
308 /* 0227 */ "\016K\017",
310 /* 0230 */ "\016o\017",
311 /* 0231 */ "\016Z\017",
312 /* 0232 */ "\016[\017",
313 /* 0233 */ "\016V\017",
314 /* 0234 */ "\016;\017",
315 /* 0235 */ "\016R\017",
317 /* 0237 */ "\016>\017",
319 /* 0240 */ "\016D\017",
320 /* 0241 */ "\016U\017",
321 /* 0242 */ "\016F\017",
322 /* 0243 */ "\016G\017",
323 /* 0244 */ "\0167\017",
324 /* 0245 */ "\0166\017",
325 /* 0246 */ "\016y\017",
326 /* 0247 */ "\016z\017",
328 /* 0250 */ "\0169\017",
333 /* 0253 */ "\016x\017",
334 /* 0254 */ "\016w\017",
335 /* 0255 */ "\0168\017",
336 /* 0256 */ "\016{\017",
337 /* 0257 */ "\016}\017",
345 /* 0265 */ "\016`\017",
346 /* 0266 */ "\016\042\017",
347 /* 0267 */ "\016!\017",
355 /* 0275 */ "\016?\017",
356 /* 0276 */ "\016<\017",
367 /* 0306 */ "\016b\017",
368 /* 0307 */ "\016a\017",
378 /* 0317 */ "\016:\017",
380 /* 0320 */ "\016d\017",
381 /* 0321 */ "\016c\017",
382 /* 0322 */ "\016$\017",
383 /* 0323 */ "\016%\017",
384 /* 0324 */ "\016#\017",
388 /* 0326 */ "\016e\017",
389 /* 0327 */ "\016&\017",
391 /* 0330 */ "\016'\017",
399 /* 0336 */ "\016f\017",
402 /* 0340 */ "\016g\017",
403 /* 0341 */ "\016^\017",
404 /* 0342 */ "\016_\017",
405 /* 0343 */ "\016h\017",
406 /* 0344 */ "\016j\017",
407 /* 0345 */ "\016i\017",
409 /* 0347 */ "\016q\017",
411 /* 0350 */ "\016p\017",
412 /* 0351 */ "\016m\017",
413 /* 0352 */ "\016.\017",
414 /* 0353 */ "\016-\017",
417 /* 0356 */ "\0160\017",
418 /* 0357 */ "\016(\017",
420 /* 0360 */ "\016v\017",
421 /* 0361 */ "\016~\017",
425 /* 0365 */ "\016=\017",
429 /* 0370 */ "\016z\017",
430 /* 0371 */ "\016+\017",
440 /* encoding vector for iso-8859-1 , characters 128 (0200) -> 255 (0377) */
442 static char hpgl_iso_8859_1[128][4] = {
463 /* 0221 */ "\016\017",
464 /* 0222 */ "\016\017",
481 /* 0241 */ "\0168\017",
482 /* 0242 */ "\0165\017",
483 /* 0243 */ "\016;\017",
484 /* 0244 */ "\016:\017",
485 /* 0245 */ "\016<\017",
486 /* 0246 */ "\017|\017",
487 /* 0247 */ "\016=\017",
489 /* 0250 */ "\016+\017",
491 /* 0252 */ "\016y\017",
492 /* 0253 */ "\016{\017",
496 /* 0257 */ "\0160\017",
498 /* 0260 */ "\016z\017",
499 /* 0261 */ "\016~\017",
509 /* 0272 */ "\016z\017",
510 /* 0273 */ "\016}\017",
511 /* 0274 */ "\016w\017",
512 /* 0275 */ "\016x\017",
514 /* 0277 */ "\0169\017",
516 /* 0300 */ "\016!\017",
517 /* 0301 */ "\016`\017",
518 /* 0302 */ "\016\042\017",
519 /* 0303 */ "\016a\017",
520 /* 0304 */ "\016X\017",
521 /* 0305 */ "\016P\017",
522 /* 0306 */ "\016S\017",
523 /* 0307 */ "\0164\017",
525 /* 0310 */ "\016#\017",
526 /* 0311 */ "\016\134\017",
527 /* 0312 */ "\016$\017",
528 /* 0313 */ "\016%\017",
529 /* 0314 */ "\016f\017",
530 /* 0315 */ "\016e\017",
531 /* 0316 */ "\016\046\017",
532 /* 0317 */ "\016'\017",
534 /* 0320 */ "\016c\017",
535 /* 0321 */ "\0166\017",
536 /* 0322 */ "\016h\017",
537 /* 0323 */ "\016g\017",
538 /* 0324 */ "\016_\017",
539 /* 0325 */ "\016i\017",
540 /* 0326 */ "\016Z\017",
543 /* 0330 */ "\016R\017",
544 /* 0331 */ "\016-\017",
545 /* 0332 */ "\016m\017",
546 /* 0333 */ "\016.\017",
547 /* 0334 */ "\016[\017",
549 /* 0336 */ "\016p\017",
550 /* 0337 */ "\016^\017",
552 /* 0340 */ "\016H\017",
553 /* 0341 */ "\016D\017",
554 /* 0342 */ "\016@\017",
555 /* 0343 */ "\016b\017",
556 /* 0344 */ "\016L\017",
557 /* 0345 */ "\016T\017",
558 /* 0346 */ "\016W\017",
559 /* 0347 */ "\0165\017",
561 /* 0350 */ "\016I\017",
562 /* 0351 */ "\016E\017",
563 /* 0352 */ "\016A\017",
564 /* 0353 */ "\016M\017",
565 /* 0354 */ "\016Y\017",
566 /* 0355 */ "\016U\017",
567 /* 0356 */ "\016Q\017",
568 /* 0357 */ "\016]\017",
570 /* 0360 */ "\016d\017",
571 /* 0361 */ "\0167\017",
572 /* 0362 */ "\016J\017",
573 /* 0363 */ "\016F\017",
574 /* 0364 */ "\016B\017",
575 /* 0365 */ "\016j\017",
576 /* 0366 */ "\016N\017",
579 /* 0370 */ "\016V\017",
580 /* 0371 */ "\016K\017",
581 /* 0372 */ "\016G\017",
582 /* 0373 */ "\016C\017",
583 /* 0374 */ "\016O\017",
585 /* 0376 */ "\016q\017",
586 /* 0377 */ "\016o\017"
591 * Static variables to keep track of where we are, etc.
594 static int HPGL_ang = 0, HPGL_x = UNKNOWN, HPGL_y = UNKNOWN,
595 HPGL_penstate = UNKNOWN, HPGL_pentype, HPGL2_pentype = UNKNOWN,
596 HPGL2_in_pe, HPGL2_lost;
599 * The subroutines, grouped by function for different versions.
602 static int HPGL_numpen, HPGL_eject;
607 HPGL_numpen = 6; /* default to six pens */
608 HPGL_eject = 0; /* default to no eject */
610 while (!END_OF_COMMAND) {
611 if (almost_equals(c_token, "eje$ct"))
613 else if (isanumber(c_token)) {
614 HPGL_numpen = (int) real(&token[c_token].l_val);
615 if (HPGL_numpen <= 0) {
617 int_error(c_token, "Number of pens must be positive");
620 int_error(c_token, "expecting \"eject\" or number of pens");
626 sprintf(term_options, "%d pens %s", HPGL_numpen,
627 HPGL_eject ? "eject" : "noeject");
630 static int HPGL2_color = 1, HPGL2_numpen = 6; /* default to 6 pen color */
631 static int HPGL2_dashed = 0; /* current dashed linetype */
632 static int HPGL2_solid = 1; /* default to solid lines */
633 static int HPGL2_font_num = 0; /* font from options */
634 static int HPGL2_font_num_current = 0; /* current font */
635 static int pspointset = 0; /* default to standard point types */
636 static double HPGL2_point_size = HPGL2_DEF_POINT; /* pointsize from options */
637 static double HPGL2_point_size_current = 0; /* current pointsize */
638 static const char *PCL_dim = "noextended"; /* default plotting dimensions */
642 HPGL2_MONOCHROME, HPGL2_COLOR, HPGL2_SOLID, HPGL2_DASHED, HPGL2_FONT,
643 HPGL2_SIZE, HPGL2_NOPSPOINTS, HPGL2_PSPOINTS,
647 static struct gen_table HPGL2_opts[] =
649 { "mono$chrome", HPGL2_MONOCHROME },
650 { "col$or", HPGL2_COLOR },
651 { "col$our", HPGL2_COLOR },
652 { "sol$id", HPGL2_SOLID },
653 { "das$hed", HPGL2_DASHED },
654 { "f$ont", HPGL2_FONT },
655 { "s$ize", HPGL2_SIZE },
656 { "n$opspoints", HPGL2_NOPSPOINTS },
657 { "p$spoints", HPGL2_PSPOINTS },
658 { NULL, HPGL2_INVALID }
664 struct termentry *t = term;
667 while (!END_OF_COMMAND) {
668 switch(lookup_table(&HPGL2_opts[0],c_token)) {
669 case HPGL2_MONOCHROME:
676 if (!END_OF_COMMAND && isanumber(c_token)) {
677 HPGL2_numpen = (int) real(&token[c_token].l_val);
678 if (HPGL2_numpen <= 0) {
680 int_error(c_token, "Number of pens must be a positive");
695 if (!END_OF_COMMAND) {
696 for (i = 0; i < HPGL2_FONTS && !almost_equals(c_token, HPGL2_font_table[i].compare); i++);
697 if (i < HPGL2_FONTS) {
698 HPGL2_font = &HPGL2_font_table[i];
700 HPGL2_font_num_current = HPGL2_font_num;
703 "expecting font: stick, cg_times, univers, zapf_dingbats, antique_olive,\narial, courier, garamond_antigua, letter_gothic, cg_omega, albertus,\ntimes_new_roman, clarendon, coronet, marigold, truetype_symbols, or wingdings");
707 "expecting font: stick, cg_times, univers, zapf_dingbats, antique_olive,\narial, courier, garamond_antigua, letter_gothic, cg_omega, albertus,\ntimes_new_roman, clarendon, coronet, marigold, truetype_symbols, or wingdings");
711 if (!END_OF_COMMAND) {
712 if ((HPGL2_point_size = real(&token[c_token].l_val)) > 0.0) {
713 HPGL2_point_size_current = HPGL2_point_size;
714 t->v_char = (int) HPGL_PUPI *HPGL2_point_size / 72;
715 t->h_char = t->v_char * 2 / 3;
716 if (HPGL2_font->spacing)
717 HPGL2_font->height = HPGL2_point_size;
719 HPGL2_font->pitch = 72 * 3 / (HPGL2_point_size * 2);
721 int_error(c_token, "expecting point size: real number");
724 int_error(c_token, "expecting point size: real number");
726 case HPGL2_NOPSPOINTS:
741 sprintf(term_options+strlen(term_options)," %s %d %s \\\n"
743 HPGL2_color ? "color" : "monochrome",
744 HPGL2_color == 1 ? HPGL2_numpen : 1,
745 HPGL2_solid ? "solid" : "dashed",
747 HPGL2_font->spacing ? "height" : "pitch",
748 HPGL2_font->spacing ? HPGL2_font->height : HPGL2_font->pitch,
749 pspointset ? "pspoints" : "nopspoints");
756 PCL_MODE, PCL_EXTENDED, PCL_EXTENDED, PCL_LEGAL, PCL_LETTER,
760 static struct gen_table PCL_opts[] =
762 { "m$ode", PCL_MODE },
763 { "ext$ended", PCL_EXTENDED },
764 { "noext$ended", PCL_NOEXTENDED },
765 { "leg$al", PCL_LEGAL },
766 { "let$ter", PCL_LETTER },
767 { NULL, PCL_INVALID }
776 if (!END_OF_COMMAND && almost_equals(c_token, "m$ode")) {
778 if (!END_OF_COMMAND) {
779 for (i = 0; i < PCL_MODES && !almost_equals(c_token, PCL_mode_table[i].compare); i++);
781 PCL_mode = &PCL_mode_table[i];
783 int_error(c_token, "expecting mode: portrait or landscape");
786 int_error(c_token, "expecting mode: portrait or landscape");
788 if (!END_OF_COMMAND && almost_equals(c_token, "ext$ended")) {
789 PCL_mode->xmax = (HPGL_XMAX_D);
790 PCL_mode->ymax = (HPGL_YMAX_D - 60);
791 PCL_dim = "extended";
793 } else if (!END_OF_COMMAND && almost_equals(c_token, "noext$ended")) {
794 PCL_mode->xmax = (HPGL_XMAX_C);
795 PCL_mode->ymax = (HPGL_YMAX_C - 60);
796 PCL_dim = "noextended";
798 } else if (!END_OF_COMMAND && almost_equals(c_token, "leg$al")) {
799 PCL_mode->xmax = (HPGL_XMAX_B);
800 PCL_mode->ymax = (HPGL_YMAX_B - 60);
803 } else if (!END_OF_COMMAND && almost_equals(c_token, "let$ter")) {
804 PCL_mode->xmax = (HPGL_XMAX_A);
805 PCL_mode->ymax = (HPGL_YMAX_A - 60);
809 sprintf(term_options, "%s %s", PCL_mode->name, PCL_dim);
818 /* void HPGL2_init ()
825 struct termentry *t = term;
827 * Reset printer, set to one copy, orientation of user's choice.
828 * Make the change to the new orientation all at once.
830 fprintf(gpoutfile, "\033E\033&l1X%s\n", PCL_mode->command);
831 t->xmax = PCL_mode->xmax;
832 t->ymax = PCL_mode->ymax;
834 * Enter HPGL/2 graphics mode
835 * Necessary here to keep the first DI0,1DI1,0 orientation command from being
836 * printed as literal text on the page for some devices. Hopefully this
837 * workaround has no bad consequences elsewhere; omit this line if it does.
839 fputs("\033%0B", gpoutfile);
845 fputs("\033.Y\n\033.I81;;17:\033.N;19:\033.M500:\n", gpoutfile);
847 1. enable eavesdropping
850 "IN;%s\nSC0,%d,0,%d;\nSR%f,%f;\n",
851 ((encoding == S_ENC_CP850) || (encoding == S_ENC_ISO8859_1)) ?
853 HPGL_XMAX, HPGL_YMAX, ((double) (HPGL_HCHAR) * 200 / 3 / HPGL_XMAX), ((double) (HPGL_VCHAR) * 100 / 2 / HPGL_YMAX));
855 1. reset to power-up defaults
857 3. set character size
868 * SD - Set default font
870 fprintf(gpoutfile, "INSP1SD1,%d,2,%d,", HPGL2_font->symbol_set, HPGL2_font->spacing);
871 if (HPGL2_font->spacing)
872 fprintf(gpoutfile, "4,%f,", HPGL2_font->height);
874 fprintf(gpoutfile, "3,%f,", HPGL2_font->pitch);
875 fprintf(gpoutfile, "5,%d,6,%d,7,%d;SS;\n", HPGL2_font->posture, HPGL2_font->stroke_weight, HPGL2_font->typeface);
877 * Add a set of user-defined dashed linetypes if the dashed option is
878 * selected. Of course, the UL's below can be edited to user preference.
880 if (HPGL2_solid == 0) {
883 UL2,8,8,9,8,8,9,8,8,9,8,8,9;\n\
884 UL3,6,6,6,7,6,6,6,7,6,6,6,7,6,6,6,7;\n\
885 UL4,5,5,5,10,5,5,5,10,5,5,5,10;\n\
886 UL5,5,5,5,5,5,8,5,5,5,5,5,8,5,5,5,5,5,9;\n\
887 UL6,8,8,0,9,8,8,0,9,8,8,0,9;\n\
888 UL7,4,4,4,4,0,4,4,4,4,4,0,4,4,4,4,4,0,4;\n\
889 UL8,6,6,6,6,6,6,0,6,6,6,6,6,6,6,0,6;\n",
895 HPGL_ang = 0; /* Horizontal */
896 HPGL2_in_pe = FALSE; /* Not in PE command */
897 HPGL2_lost = TRUE; /* Pen position is unknown */
898 HPGL_penstate = UP; /* Pen is up */
905 * Enter HPGL/2 graphics mode
907 fputs("\033%0B", gpoutfile);
914 if (HPGL_eject == 0) {
915 fputs("PUSP0;\033.Z\n\0", gpoutfile);
919 3. disable eavesdropping
922 fputs("PUSP0;PG;\033.Z\n\0", gpoutfile);
927 4. disable eavesdropping
938 * If in Polyline Encoded command, leave Polyline Encoded command
941 fputs(";\n", gpoutfile);
947 fputs("PUSP0;", gpoutfile);
956 fputs(";\n", gpoutfile);
960 * Go into PCL mode and eject the page
962 fputs("\033%1A\033&l0H\n\0", gpoutfile);
966 HPGL_linetype(int linetype)
970 /* allow for set number of pens */
971 linetype = (linetype + 2) % HPGL_numpen + 1;
972 /* only select pen if necessary */
973 if (HPGL_pentype != linetype) {
974 fprintf(gpoutfile, "PU;\nSP%d;\n", linetype);
975 HPGL_pentype = linetype;
981 HPGL2_linetype(int linetype)
984 * If in Polyline Encoded command, leave Polyline Encoded command
987 fputs(";\n", gpoutfile);
990 /* allow for set number of pens for color displays */
991 if (HPGL2_color == 1) {
993 if (HPGL2_solid == 0)
994 HPGL2_dashed = linetype % HPGL2_LINETYPES + 1;
995 linetype = (linetype + 2) % HPGL2_numpen + 1;
997 /* only select pen if necessary */
998 if (linetype != HPGL2_pentype) {
1000 if (HPGL2_solid == 0) {
1001 fprintf(gpoutfile, "PU;\nSP%d;\nLT%d;", linetype, HPGL2_dashed);
1003 fprintf(gpoutfile, "PU;\nSP%d;\nLT;", linetype);
1004 /* Borders and Tics */
1005 } else if (linetype == LT_BLACK) {
1006 fprintf(gpoutfile, "PU;\nSP1;\nPW.2LT");
1007 /* Axes and Grids */
1008 } else if (linetype == LT_AXIS)
1009 fprintf(gpoutfile, "PU;\nSP1;\nPW.2LT1,.25");
1011 HPGL2_pentype = linetype;
1013 /* allow for lots of linetypes for monochrome displays */
1015 if (linetype >= 0) {
1016 if (HPGL2_solid == 0)
1017 HPGL2_dashed = linetype % HPGL2_LINETYPES + 1;
1018 linetype = linetype % (HPGL2_LINETYPES * HPGL2_PENWIDTHS);
1020 /* only select pen if necessary */
1021 if (linetype != HPGL2_pentype) {
1022 if (linetype >= 0) {
1023 if (HPGL2_solid == 0) {
1024 fprintf(gpoutfile, "PW%sLT%d%s", HPGL2_pw[linetype / HPGL2_LINETYPES], HPGL2_dashed,
1025 HPGL2_lt[linetype % HPGL2_LINETYPES]);
1027 fprintf(gpoutfile, "PW%sLT", HPGL2_pw[linetype / HPGL2_LINETYPES]);
1028 /* Borders and Tics */
1029 } else if (linetype == LT_BLACK) {
1030 fprintf(gpoutfile, "PW.2LT");
1031 /* Axes and Grids */
1032 } else if (linetype == LT_AXIS)
1033 fprintf(gpoutfile, "PW.1LT1,.25");
1034 HPGL2_pentype = linetype;
1040 HPGL_put_text(unsigned int x, unsigned int y, const char *str)
1043 HPGL_move(x + HPGL_VCHAR / 4, y);
1045 HPGL_move(x, y - HPGL_VCHAR / 4);
1046 if (encoding == S_ENC_CP850) {
1048 fputs("LB", gpoutfile);
1049 for (s = (unsigned char *) str; *s; ++s)
1050 if (*s >= 128 && hpgl_cp_850[*s - 128][0])
1051 fputs(hpgl_cp_850[*s - 128], gpoutfile);
1053 putc(*s, gpoutfile);
1054 fputs("\003\n", gpoutfile);
1055 } else if (encoding == S_ENC_ISO8859_1) {
1057 fputs("LB", gpoutfile);
1058 for (s = (unsigned char *) str; *s; ++s)
1059 if (*s >= 128 && hpgl_iso_8859_1[*s - 128][0])
1060 fputs(hpgl_iso_8859_1[*s - 128], gpoutfile);
1062 putc(*s, gpoutfile);
1063 fputs("\003\n", gpoutfile);
1065 fprintf(gpoutfile, "LB%s\003\n", str);
1069 HPGL2_put_text(unsigned int x, unsigned int y, const char *str)
1071 struct termentry *t = term;
1076 HPGL2_move(x + t->v_char / 4, y);
1078 HPGL2_move(x, y - t->v_char / 4);
1080 * If in Polyline Encoded command, leave Polyline Encoded command
1083 fputs(";\n", gpoutfile);
1087 * Print the text string
1089 fprintf(gpoutfile, "LB%s\003\n", str);
1094 * Some early HPGL plotters (e.g. HP7220C) require the
1095 * Pen Up/Down and Pen (move) Absolute commands to be separate.
1099 HPGL_move(unsigned int x, unsigned int y)
1101 if (HPGL_x != x || HPGL_y != y) { /* only move if necessary */
1102 fprintf(gpoutfile, "PU;PA%d,%d;\n", x, y);
1110 HPGL_vector(unsigned int x, unsigned int y)
1112 if (HPGL_penstate != DOWN) {
1113 fprintf(gpoutfile, "PD;PA%d,%d;\n", x, y);
1114 HPGL_penstate = DOWN;
1116 fprintf(gpoutfile, "PA%d,%d;\n", x, y);
1122 HPGL2_move(unsigned int x, unsigned int y)
1128 fputs("<", gpoutfile);
1131 fputs("PE<", gpoutfile);
1133 fputs("PE7<", gpoutfile);
1139 fputs("=", gpoutfile);
1146 #if HPGL2_EXPLICIT_PD
1147 if (HPGL_penstate == DOWN)
1152 fputs("\n", gpoutfile);
1158 HPGL2_vector(unsigned int x, unsigned int y)
1166 fputs("PE", gpoutfile);
1168 fputs("PE7", gpoutfile);
1174 fputs("=", gpoutfile);
1181 #if HPGL2_EXPLICIT_PD
1183 * Put the pen down in the current position,
1184 * relative vector of 0,0.
1186 if (HPGL_penstate == UP) {
1187 fputc((char) HPGL2_HIGH_OFFS, gpoutfile);
1188 fputc((char) HPGL2_HIGH_OFFS, gpoutfile);
1189 HPGL_penstate = DOWN;
1194 fputs("\n", gpoutfile);
1200 * Routine to encode position in base 32 or base 64 characters
1214 fputc((char) (c + HPGL2_LOW_OFFS), gpoutfile);
1216 fputc((char) (c + HPGL2_HIGH_OFFS), gpoutfile);
1221 HPGL_text_angle(int ang)
1223 if (ang == -90 || ang == 270)
1226 HPGL_ang = (ang ? 1 : 0);
1228 if (HPGL_ang == 0) /* Horizontal */
1229 fputs("DI1,0;\n", gpoutfile);
1230 else if (HPGL_ang == -1) /* Vertical Down */
1231 fputs("DI0,-1;\n", gpoutfile);
1232 else /* Vertical Up */
1233 fputs("DI0,1;\n", gpoutfile);
1238 HPGL2_text_angle(int ang)
1241 * If in Polyline Encoded command, leave Polyline Encoded command
1243 if (ang == -90 || ang == 270)
1246 HPGL_ang = (ang ? 1 : 0);
1249 fputs(";", gpoutfile);
1252 if (HPGL_ang == 1) /* Vertical Up */
1253 fputs("DI0,1", gpoutfile);
1254 else if (HPGL_ang == -1) /* Vertical Down */
1255 fputs("DI0,-1", gpoutfile);
1256 else /* Horizontal */
1257 fputs("DI1,0", gpoutfile);
1278 fputs("SP0PG;\n", gpoutfile);
1287 * Return to PCL mode
1288 * Printer reset (conditional eject)
1290 fputs("\033%0A\033E\n", gpoutfile);
1294 HPGL2_justify_text(enum JUSTIFY just)
1297 * If in Polyline Encoded command, leave Polyline Encoded command
1300 fputs(";\n", gpoutfile);
1305 fputs("LO1", gpoutfile);
1308 fputs("LO4", gpoutfile);
1311 fputs("LO7", gpoutfile);
1320 HPGL2_set_font(const char *font)
1322 struct termentry *t = term;
1323 char name[MAX_ID_LEN + 1];
1324 int i, sep, int_size, sep2;
1327 * If in Polyline Encoded command, leave Polyline Encoded command
1330 fputs(";\n", gpoutfile);
1333 /* determine font, use default from options if invalid */
1334 sep = strcspn(font, ",");
1335 strncpy(name, font, sep);
1337 for (i = 0; i < HPGL2_FONTS; i++) {
1338 sep2 = strcspn(HPGL2_font_table[i].compare, "$");
1339 if (strncmp(name, HPGL2_font_table[i].compare, sep2) == 0)
1342 if (i >= HPGL2_FONTS)
1344 /* determine font size, use default from options if invalid */
1346 sscanf(&(font[sep + 1]), "%d", &int_size);
1350 size = HPGL2_point_size;
1351 /* apply font changes only if necessary */
1352 if (size == HPGL2_point_size_current && i == HPGL2_font_num_current)
1354 HPGL2_font = &HPGL2_font_table[i];
1355 HPGL2_font_num_current = i;
1356 HPGL2_point_size_current = size;
1357 t->v_char = (int) HPGL_PUPI *HPGL2_point_size_current / 72;
1358 t->h_char = t->v_char * 2 / 3;
1359 fprintf(gpoutfile, "SD1,%d,2,%d,", HPGL2_font->symbol_set, HPGL2_font->spacing);
1360 if (HPGL2_font->spacing) {
1361 HPGL2_font->height = HPGL2_point_size_current;
1362 fprintf(gpoutfile, "4,%f,", HPGL2_font->height);
1364 HPGL2_font->pitch = 72 * 3 / (HPGL2_point_size_current * 2);
1365 fprintf(gpoutfile, "3,%f,", HPGL2_font->pitch);
1367 fprintf(gpoutfile, "5,%d,6,%d,7,%d;SS;\n", HPGL2_font->posture, HPGL2_font->stroke_weight, HPGL2_font->typeface);
1372 HPGL2_point(unsigned int x, unsigned int y, int number)
1375 if (pspointset) { /* postscript style points */
1377 HPGL2_neg_point(x, y, number);
1379 htic = (int) (HPGL2_psize * PCL_HTIC / 2);
1380 vtic = (int) (HPGL2_psize * PCL_VTIC / 2);
1381 number %= HPGL2_NUM_PSPOINTS;
1384 HPGL2_move(x - htic, y);
1385 HPGL2_vector(x - htic, y);
1386 HPGL2_vector(x + htic, y);
1387 HPGL2_move(x, y - vtic);
1388 HPGL2_vector(x, y - vtic);
1389 HPGL2_vector(x, y + vtic);
1392 HPGL2_move(x - htic, y - vtic);
1393 HPGL2_vector(x - htic, y - vtic);
1394 HPGL2_vector(x + htic, y + vtic);
1395 HPGL2_move(x - htic, y + vtic);
1396 HPGL2_vector(x - htic, y + vtic);
1397 HPGL2_vector(x + htic, y - vtic);
1400 HPGL2_move(x - htic, y);
1401 HPGL2_vector(x - htic, y);
1402 HPGL2_vector(x + htic, y);
1403 HPGL2_move(x, y - vtic);
1404 HPGL2_vector(x, y - vtic);
1405 HPGL2_vector(x, y + vtic);
1406 HPGL2_move(x - htic, y - vtic);
1407 HPGL2_vector(x - htic, y - vtic);
1408 HPGL2_vector(x + htic, y + vtic);
1409 HPGL2_move(x - htic, y + vtic);
1410 HPGL2_vector(x - htic, y + vtic);
1411 HPGL2_vector(x + htic, y - vtic);
1413 case 3: /* hollow square 1 */
1414 HPGL2_move(x - (3 * htic / 4), y - (3 * vtic / 4));
1415 HPGL2_vector(x + (3 * htic / 4), y - (3 * vtic / 4));
1416 HPGL2_vector(x + (3 * htic / 4), y + (3 * vtic / 4));
1417 HPGL2_vector(x - (3 * htic / 4), y + (3 * vtic / 4));
1418 HPGL2_vector(x - (3 * htic / 4), y - (3 * vtic / 4));
1422 case 4: /* solid square 1 */
1423 HPGL2_move(x - (3 * htic / 4), y - (3 * vtic / 4));
1424 fputs(";\n", gpoutfile);
1426 fprintf(gpoutfile, "RA%.2f,%.2f;EP;\n", ((double) x + (3 * htic / 4)), ((double) y + (3 * vtic / 4)));
1428 case 5: /* hollow circle 1 */
1431 fputs(";\n", gpoutfile);
1433 fprintf(gpoutfile, "CI%.2f;\n", ((double) 3 * (htic) / 4));
1435 case 6: /* solid circle 1 */
1437 fputs(";\n", gpoutfile);
1439 fprintf(gpoutfile, "WG%.2f,0,360;EP;\n", ((double) 3 * (htic) / 4));
1441 case 7: /* hollow triangle 1 */
1442 HPGL2_move(x, y + (3 * vtic / 4));
1443 HPGL2_vector(x - (3 * sqrt(3) * htic / 8), y - (3 * vtic / 8));
1444 HPGL2_vector(x + (3 * sqrt(3) * htic / 8), y - (3 * vtic / 8));
1445 HPGL2_vector(x, y + (3 * vtic / 4));
1449 case 8: /* solid triangle 1 */
1450 HPGL2_move(x, y + (3 * vtic / 4));
1451 fputs(";\n", gpoutfile);
1453 fprintf(gpoutfile, "PM0;\n");
1454 HPGL2_vector(x - (3 * sqrt(3) * htic / 8), y - (3 * vtic / 8));
1455 HPGL2_vector(x + (3 * sqrt(3) * htic / 8), y - (3 * vtic / 8));
1456 HPGL2_vector(x, y + (3 * vtic / 4));
1457 fputs(";\n", gpoutfile);
1459 fprintf(gpoutfile, "PM2;FP;EP;\n");
1461 case 9: /* hollow triangle 2 */
1462 HPGL2_move(x, y - (3 * vtic / 4));
1463 HPGL2_vector(x - (3 * sqrt(3) * htic / 8), y + (3 * vtic / 8));
1464 HPGL2_vector(x + (3 * sqrt(3) * htic / 8), y + (3 * vtic / 8));
1465 HPGL2_vector(x, y - (3 * vtic / 4));
1469 case 10: /* solid triangle 2 */
1470 HPGL2_move(x, y - (3 * vtic / 4));
1471 fputs(";\n", gpoutfile);
1473 fprintf(gpoutfile, "PM0;\n");
1474 HPGL2_vector(x - (3 * sqrt(3) * htic / 8), y + (3 * vtic / 8));
1475 HPGL2_vector(x + (3 * sqrt(3) * htic / 8), y + (3 * vtic / 8));
1476 HPGL2_vector(x, y - (3 * vtic / 4));
1477 fputs(";\n", gpoutfile);
1479 fprintf(gpoutfile, "PM2;FP;EP;\n");
1481 case 11: /* hollow diamond 1 */
1482 HPGL2_move(x - (3 * htic / 4), y);
1483 HPGL2_vector(x, y - (3 * vtic / 4));
1484 HPGL2_vector(x + (3 * htic / 4), y);
1485 HPGL2_vector(x, y + (3 * vtic / 4));
1486 HPGL2_vector(x - (3 * htic / 4), y);
1490 case 12: /* solid diamond 1 */
1491 HPGL2_move(x - (3 * htic / 4), y);
1492 fputs(";\n", gpoutfile);
1494 fprintf(gpoutfile, "PM0;\n");
1495 HPGL2_vector(x, y - (3 * vtic / 4));
1496 HPGL2_vector(x + (3 * htic / 4), y);
1497 HPGL2_vector(x, y + (3 * vtic / 4));
1498 HPGL2_vector(x - (3 * htic / 4), y);
1499 fputs(";\n", gpoutfile);
1501 fprintf(gpoutfile, "PM2;FP;EP;\n");
1503 case 13: /* hollow pentagon 1 */
1504 HPGL2_move(x, y + (3 * vtic / 4));
1505 HPGL2_vector(x - (cos(.1 * acos(-1)) * 3 * htic / 4), y + (sin(.1 * acos(-1)) * 3 * vtic / 4));
1506 HPGL2_vector(x - (sin(.2 * acos(-1)) * 3 * htic / 4), y - (cos(.2 * acos(-1)) * 3 * vtic / 4));
1507 HPGL2_vector(x + (sin(.2 * acos(-1)) * 3 * htic / 4), y - (cos(.2 * acos(-1)) * 3 * vtic / 4));
1508 HPGL2_vector(x + (cos(.1 * acos(-1)) * 3 * htic / 4), y + (sin(.1 * acos(-1)) * 3 * vtic / 4));
1509 HPGL2_vector(x, y + (3 * vtic / 4));
1513 case 14: /* solid pentagon */
1514 HPGL2_move(x, y + (3 * vtic / 4));
1515 fputs(";\n", gpoutfile);
1517 fprintf(gpoutfile, "PM0;\n");
1518 HPGL2_vector(x - (cos(.1 * acos(-1)) * 3 * htic / 4), y + (sin(.1 * acos(-1)) * 3 * vtic / 4));
1519 HPGL2_vector(x - (sin(.2 * acos(-1)) * 3 * htic / 4), y - (cos(.2 * acos(-1)) * 3 * vtic / 4));
1520 HPGL2_vector(x + (sin(.2 * acos(-1)) * 3 * htic / 4), y - (cos(.2 * acos(-1)) * 3 * vtic / 4));
1521 HPGL2_vector(x + (cos(.1 * acos(-1)) * 3 * htic / 4), y + (sin(.1 * acos(-1)) * 3 * vtic / 4));
1522 HPGL2_vector(x, y + (3 * vtic / 4));
1523 fputs(";\n", gpoutfile);
1525 fprintf(gpoutfile, "PM2;FP;EP;\n");
1527 case 15: /* hollow circle 2 */
1528 HPGL2_move(x, y + vtic);
1530 fputs(";\n", gpoutfile);
1532 fprintf(gpoutfile, "CI%d;\n", htic);
1534 case 16: /* semisolid circle 1 */
1536 fputs(";\n", gpoutfile);
1538 fprintf(gpoutfile, "WG%d,0,90;EP;EW%d,90,270;\n", htic, htic);
1540 case 17: /* semisolid circle 2 */
1542 fputs(";\n", gpoutfile);
1544 fprintf(gpoutfile, "WG%d,90,90;EP;EW%d,180,270;\n", htic, htic);
1546 case 18: /* semisolid circle 3 */
1548 fputs(";\n", gpoutfile);
1550 fprintf(gpoutfile, "WG%d,0,180;EP;EW%d,180,180;\n", htic, htic);
1552 case 19: /* semisolid circle 4 */
1554 fputs(";\n", gpoutfile);
1556 fprintf(gpoutfile, "WG%d,180,90;EP;EW%d,270,270;\n", htic, htic);
1558 case 20: /* semisolid circle 5 */
1560 fputs(";\n", gpoutfile);
1562 fprintf(gpoutfile, "WG%d,0,90;EP;EW%d,90,90;WG%d,180,90;EP;EW%d,270,90;\n", htic, htic, htic, htic);
1564 case 21: /* semisolid circle 6 */
1566 fputs(";\n", gpoutfile);
1568 fprintf(gpoutfile, "WG%d,90,180;EP;EW%d,270,180;\n", htic, htic);
1570 case 22: /* semisolid circle 7 */
1572 fputs(";\n", gpoutfile);
1574 fprintf(gpoutfile, "WG%d,0,270;EP;EW%d,270,90;\n", htic, htic);
1576 case 23: /* semisolid circle 8 */
1578 fputs(";\n", gpoutfile);
1580 fprintf(gpoutfile, "WG%d,270,90;EP;EW%d,0,270;\n", htic, htic);
1582 case 24: /* semisolid circle 9 */
1584 fputs(";\n", gpoutfile);
1586 fprintf(gpoutfile, "WG%d,270,180;EP;EW%d,90,180;\n", htic, htic);
1588 case 25: /* semisolid circle 10 */
1590 fputs(";\n", gpoutfile);
1592 fprintf(gpoutfile, "WG%d,90,90;EP;EW%d,180,90;WG%d,270,90;EP;EW%d,0,90;\n", htic, htic, htic, htic);
1594 case 26: /* semisolid circle 11 */
1596 fputs(";\n", gpoutfile);
1598 fprintf(gpoutfile, "WG%d,270,270;EP;EW%d,180,90;\n", htic, htic);
1600 case 27: /* semisolid circle 12 */
1602 fputs(";\n", gpoutfile);
1604 fprintf(gpoutfile, "WG%d,180,180;EP;EW%d,0,180;\n", htic, htic);
1606 case 28: /* semisolid circle 13 */
1608 fputs(";\n", gpoutfile);
1610 fprintf(gpoutfile, "WG%d,180,270;EP;EW%d,90,90;\n", htic, htic);
1612 case 29: /* semisolid circle 14 */
1614 fputs(";\n", gpoutfile);
1616 fprintf(gpoutfile, "WG%d,90,270;EP;EW%d,0,90;\n", htic, htic);
1618 case 30: /* solid circle 2 */
1620 fputs(";\n", gpoutfile);
1622 fprintf(gpoutfile, "WG%d,0,360;EP;\n", htic);
1624 case 31: /* hollow square 2 */
1625 HPGL2_move(x - htic, y - vtic);
1626 HPGL2_vector(x + htic, y - vtic);
1627 HPGL2_vector(x + htic, y + vtic);
1628 HPGL2_vector(x - htic, y + vtic);
1629 HPGL2_vector(x - htic, y - vtic);
1630 HPGL2_move(x, y + vtic);
1633 case 32: /* semisolid square 1 */
1634 HPGL2_move(x, y + vtic);
1635 HPGL2_vector(x - htic, y + vtic);
1636 HPGL2_vector(x - htic, y - vtic);
1637 HPGL2_vector(x + htic, y - vtic);
1638 HPGL2_vector(x + htic, y);
1640 fputs(";\n", gpoutfile);
1642 fprintf(gpoutfile, "RA%d,%d;EP;\n", x + htic, y + vtic);
1644 case 33: /* semisolid square 2 */
1645 HPGL2_move(x - htic, y);
1646 HPGL2_vector(x - htic, y - vtic);
1647 HPGL2_vector(x + htic, y - vtic);
1648 HPGL2_vector(x + htic, y + vtic);
1649 HPGL2_vector(x, y + vtic);
1650 HPGL2_move(x - htic, y);
1651 fputs(";\n", gpoutfile);
1653 fprintf(gpoutfile, "RA%d,%d;EP;\n", x, y + vtic);
1655 case 34: /* semisolid square 3 */
1656 HPGL2_move(x - htic, y);
1657 HPGL2_vector(x - htic, y - vtic);
1658 HPGL2_vector(x + htic, y - vtic);
1659 HPGL2_vector(x + htic, y);
1660 HPGL2_move(x - htic, y);
1661 fputs(";\n", gpoutfile);
1663 fprintf(gpoutfile, "RA%d,%d;EP;\n", x + htic, y + vtic);
1665 case 35: /* semisolid square 4 */
1666 HPGL2_move(x, y - vtic);
1667 HPGL2_vector(x + htic, y - vtic);
1668 HPGL2_vector(x + htic, y + vtic);
1669 HPGL2_vector(x - htic, y + vtic);
1670 HPGL2_vector(x - htic, y);
1671 HPGL2_move(x - htic, y - vtic);
1672 fputs(";\n", gpoutfile);
1674 fprintf(gpoutfile, "RA%d,%d;EP;\n", x, y);
1676 case 36: /* semisolid square 5 */
1677 HPGL2_move(x, y - vtic);
1678 HPGL2_vector(x + htic, y - vtic);
1679 HPGL2_vector(x + htic, y);
1680 HPGL2_move(x, y + vtic);
1681 HPGL2_vector(x - htic, y + vtic);
1682 HPGL2_vector(x - htic, y);
1683 HPGL2_move(x - htic, y - vtic);
1684 fputs(";\n", gpoutfile);
1686 fprintf(gpoutfile, "RA%d,%d;EP;\n", x, y);
1688 fputs(";\n", gpoutfile);
1690 fprintf(gpoutfile, "RA%d,%d;EP;\n", x + htic, y + vtic);
1692 case 37: /* semisolid square 6 */
1693 HPGL2_move(x, y - vtic);
1694 HPGL2_vector(x + htic, y - vtic);
1695 HPGL2_vector(x + htic, y + vtic);
1696 HPGL2_vector(x, y + vtic);
1697 HPGL2_move(x - htic, y - vtic);
1698 fputs(";\n", gpoutfile);
1700 fprintf(gpoutfile, "RA%d,%d;EP;\n", x, y + vtic);
1702 case 38: /* semisolid square 7 */
1703 HPGL2_move(x, y - vtic);
1704 HPGL2_vector(x + htic, y - vtic);
1705 HPGL2_vector(x + htic, y);
1706 HPGL2_move(x - htic, y - vtic);
1707 fputs(";\n", gpoutfile);
1709 fprintf(gpoutfile, "RA%d,%d;EP;\n", x, y + vtic);
1711 fputs(";\n", gpoutfile);
1713 fprintf(gpoutfile, "RA%d,%d;EP;\n", x + htic, y + vtic);
1715 case 39: /* semisolid square 8 */
1716 HPGL2_move(x + htic, y);
1717 HPGL2_vector(x + htic, y + vtic);
1718 HPGL2_vector(x - htic, y + vtic);
1719 HPGL2_vector(x - htic, y - vtic);
1720 HPGL2_vector(x, y - vtic);
1721 fputs(";\n", gpoutfile);
1723 fprintf(gpoutfile, "RA%d,%d;EP;\n", x + htic, y);
1725 case 40: /* semisolid square 9 */
1726 HPGL2_move(x, y + vtic);
1727 HPGL2_vector(x - htic, y + vtic);
1728 HPGL2_vector(x - htic, y - vtic);
1729 HPGL2_vector(x, y - vtic);
1730 fputs(";\n", gpoutfile);
1732 fprintf(gpoutfile, "RA%d,%d;EP;\n", x + htic, y + vtic);
1734 case 41: /* semisolid square 10 */
1735 HPGL2_move(x - htic, y);
1736 HPGL2_vector(x - htic, y - vtic);
1737 HPGL2_vector(x, y - vtic);
1738 HPGL2_move(x + htic, y);
1739 HPGL2_vector(x + htic, y + vtic);
1740 HPGL2_vector(x, y + vtic);
1741 HPGL2_move(x - htic, y);
1742 fputs(";\n", gpoutfile);
1744 fprintf(gpoutfile, "RA%d,%d;EP;\n", x, y + vtic);
1745 HPGL2_move(x, y - vtic);
1746 fputs(";\n", gpoutfile);
1748 fprintf(gpoutfile, "RA%d,%d;EP;\n", x + htic, y);
1750 case 42: /* semisolid square 11 */
1751 HPGL2_move(x - htic, y);
1752 HPGL2_vector(x - htic, y - vtic);
1753 HPGL2_vector(x, y - vtic);
1754 fputs(";\n", gpoutfile);
1756 fprintf(gpoutfile, "RA%d,%d;EP;\n", x + htic, y + vtic);
1757 HPGL2_move(x - htic, y);
1758 fputs(";\n", gpoutfile);
1760 fprintf(gpoutfile, "RA%d,%d;EP;\n", x, y + vtic);
1762 case 43: /* semisolid square 12 */
1763 HPGL2_move(x + htic, y);
1764 HPGL2_vector(x + htic, y + vtic);
1765 HPGL2_vector(x - htic, y + vtic);
1766 HPGL2_vector(x - htic, y);
1767 HPGL2_move(x - htic, y - vtic);
1768 fputs(";\n", gpoutfile);
1770 fprintf(gpoutfile, "RA%d,%d;EP;\n", x + htic, y);
1772 case 44: /* semisolid square 13 */
1773 HPGL2_move(x, y + vtic);
1774 HPGL2_vector(x - htic, y + vtic);
1775 HPGL2_vector(x - htic, y);
1776 HPGL2_move(x - htic, y - vtic);
1777 fputs(";\n", gpoutfile);
1779 fprintf(gpoutfile, "RA%d,%d;EP;\n", x + htic, y);
1781 fputs(";\n", gpoutfile);
1783 fprintf(gpoutfile, "RA%d,%d;EP;\n", x + htic, y + vtic);
1785 case 45: /* semisolid square 14 */
1786 HPGL2_move(x + htic, y);
1787 HPGL2_vector(x + htic, y + vtic);
1788 HPGL2_vector(x, y + vtic);
1789 HPGL2_move(x - htic, y - vtic);
1790 fputs(";\n", gpoutfile);
1792 fprintf(gpoutfile, "RA%d,%d;EP;\n", x + htic, y);
1793 HPGL2_move(x - htic, y);
1794 fputs(";\n", gpoutfile);
1796 fprintf(gpoutfile, "RA%d,%d;EP;\n", x, y + vtic);
1798 case 46: /* solid square 2 */
1799 HPGL2_move(x - htic, y - vtic);
1800 fputs(";\n", gpoutfile);
1802 fprintf(gpoutfile, "RA%d,%d;EP;\n", x + htic, y + vtic);
1804 case 47: /* hollow diamond 2 */
1805 HPGL2_move(x - htic, y);
1806 HPGL2_vector(x, y - vtic);
1807 HPGL2_vector(x + htic, y);
1808 HPGL2_vector(x, y + vtic);
1809 HPGL2_vector(x - htic, y);
1810 HPGL2_move(x - (htic / 2), y + (vtic / 2));
1813 case 48: /* semisolid diamond 1 */
1814 HPGL2_move(x - (htic / 2), y + (vtic / 2));
1815 HPGL2_vector(x - htic, y);
1816 HPGL2_vector(x, y - vtic);
1817 HPGL2_vector(x + htic, y);
1818 HPGL2_vector(x + (htic / 2), y + (vtic / 2));
1819 fputs(";\n", gpoutfile);
1821 fprintf(gpoutfile, "PM0;\n");
1822 HPGL2_vector(x, y + vtic);
1823 HPGL2_vector(x - (htic / 2), y + (vtic / 2));
1825 HPGL2_vector(x + (htic / 2), y + (vtic / 2));
1826 fputs(";\n", gpoutfile);
1828 fprintf(gpoutfile, "PM2;FP;EP;\n");
1830 case 49: /* semisolid diamond 2 */
1831 HPGL2_move(x - (htic / 2), y - (vtic / 2));
1832 HPGL2_vector(x, y - vtic);
1833 HPGL2_vector(x + htic, y);
1834 HPGL2_vector(x, y + vtic);
1835 HPGL2_vector(x - (htic / 2), y + (vtic / 2));
1836 fputs(";\n", gpoutfile);
1838 fprintf(gpoutfile, "PM0;\n");
1839 HPGL2_vector(x - htic, y);
1840 HPGL2_vector(x - (htic / 2), y - (vtic / 2));
1842 HPGL2_vector(x - (htic / 2), y + (vtic / 2));
1843 fputs(";\n", gpoutfile);
1845 fprintf(gpoutfile, "PM2;FP;EP;\n");
1847 case 50: /* semisolid diamond 3 */
1848 HPGL2_move(x - (htic / 2), y - (vtic / 2));
1849 HPGL2_vector(x, y - vtic);
1850 HPGL2_vector(x + htic, y);
1851 HPGL2_vector(x + (htic / 2), y + (vtic / 2));
1852 fputs(";\n", gpoutfile);
1854 fprintf(gpoutfile, "PM0;\n");
1855 HPGL2_vector(x - (htic / 2), y - (vtic / 2));
1856 HPGL2_vector(x - htic, y);
1857 HPGL2_vector(x, y + vtic);
1858 HPGL2_vector(x + (htic / 2), y + (vtic / 2));
1859 fputs(";\n", gpoutfile);
1861 fprintf(gpoutfile, "PM2;FP;EP;\n");
1863 case 51: /* semisolid diamond 4 */
1864 HPGL2_move(x + (htic / 2), y - (vtic / 2));
1865 HPGL2_vector(x + htic, y);
1866 HPGL2_vector(x, y + vtic);
1867 HPGL2_vector(x - htic, y);
1868 HPGL2_vector(x - (htic / 2), y - (vtic / 2));
1869 fputs(";\n", gpoutfile);
1871 fprintf(gpoutfile, "PM0;\n");
1873 HPGL2_vector(x + (htic / 2), y - (vtic / 2));
1874 HPGL2_vector(x, y - vtic);
1875 HPGL2_vector(x - (htic / 2), y - (vtic / 2));
1876 fputs(";\n", gpoutfile);
1878 fprintf(gpoutfile, "PM2;FP;EP;\n");
1880 case 52: /* semisolid diamond 5 */
1881 HPGL2_move(x - (htic / 2), y + (vtic / 2));
1882 HPGL2_vector(x - htic, y);
1883 HPGL2_vector(x - (htic / 2), y - (vtic / 2));
1884 fputs(";\n", gpoutfile);
1886 fprintf(gpoutfile, "PM0;\n");
1888 HPGL2_vector(x + (htic / 2), y - (vtic / 2));
1889 HPGL2_vector(x, y - vtic);
1890 HPGL2_vector(x - (htic / 2), y - (vtic / 2));
1891 fputs(";\n", gpoutfile);
1893 fprintf(gpoutfile, "PM2;FP;EP;\n");
1894 HPGL2_move(x + (htic / 2), y - (vtic / 2));
1895 HPGL2_vector(x + htic, y);
1896 HPGL2_vector(x + (htic / 2), y + (vtic / 2));
1897 fputs(";\n", gpoutfile);
1899 fprintf(gpoutfile, "PM0;\n");
1900 HPGL2_vector(x, y + vtic);
1901 HPGL2_vector(x - (htic / 2), y + (vtic / 2));
1903 HPGL2_vector(x + (htic / 2), y + (vtic / 2));
1904 fputs(";\n", gpoutfile);
1906 fprintf(gpoutfile, "PM2;FP;EP;\n");
1908 case 53: /* semisolid diamond 6 */
1909 HPGL2_move(x + (htic / 2), y - (vtic / 2));
1910 HPGL2_vector(x + htic, y);
1911 HPGL2_vector(x, y + vtic);
1912 HPGL2_vector(x - (htic / 2), y + (vtic / 2));
1913 fputs(";\n", gpoutfile);
1915 fprintf(gpoutfile, "PM0;\n");
1916 HPGL2_vector(x - htic, y);
1917 HPGL2_vector(x, y - vtic);
1918 HPGL2_vector(x + (htic / 2), y - (vtic / 2));
1919 HPGL2_vector(x - (htic / 2), y + (vtic / 2));
1920 fputs(";\n", gpoutfile);
1922 fprintf(gpoutfile, "PM2;FP;EP;\n");
1924 case 54: /* semisolid diamond 7 */
1925 HPGL2_move(x + (htic / 2), y - (vtic / 2));
1926 HPGL2_vector(x + htic, y);
1927 HPGL2_vector(x + (htic / 2), y + (vtic / 2));
1928 fputs(";\n", gpoutfile);
1930 fprintf(gpoutfile, "PM0;\n");
1931 HPGL2_vector(x, y + vtic);
1932 HPGL2_vector(x - htic, y);
1933 HPGL2_vector(x, y - vtic);
1934 HPGL2_vector(x + (htic / 2), y - (vtic / 2));
1936 HPGL2_vector(x + (htic / 2), y + (vtic / 2));
1937 fputs(";\n", gpoutfile);
1939 fprintf(gpoutfile, "PM2;FP;EP;\n");
1941 case 55: /* semisolid diamond 8 */
1942 HPGL2_move(x + (htic / 2), y + (vtic / 2));
1943 HPGL2_vector(x, y + vtic);
1944 HPGL2_vector(x - htic, y);
1945 HPGL2_vector(x, y - vtic);
1946 HPGL2_vector(x + (htic / 2), y - (vtic / 2));
1947 fputs(";\n", gpoutfile);
1949 fprintf(gpoutfile, "PM0;\n");
1951 HPGL2_vector(x + (htic / 2), y + (vtic / 2));
1952 HPGL2_vector(x + htic, y);
1953 HPGL2_vector(x + (htic / 2), y - (vtic / 2));
1954 fputs(";\n", gpoutfile);
1956 fprintf(gpoutfile, "PM2;FP;EP;\n");
1958 case 56: /* semisolid diamond 9 */
1959 HPGL2_move(x - (htic / 2), y + (vtic / 2));
1960 HPGL2_vector(x - htic, y);
1961 HPGL2_vector(x, y - vtic);
1962 HPGL2_vector(x + (htic / 2), y - (vtic / 2));
1963 fputs(";\n", gpoutfile);
1965 fprintf(gpoutfile, "PM0;\n");
1966 HPGL2_vector(x - (htic / 2), y + (vtic / 2));
1967 HPGL2_vector(x, y + vtic);
1968 HPGL2_vector(x + htic, y);
1969 HPGL2_vector(x + (htic / 2), y - (vtic / 2));
1970 fputs(";\n", gpoutfile);
1972 fprintf(gpoutfile, "PM2;FP;EP;\n");
1974 case 57: /* semisolid diamond 10 */
1975 HPGL2_move(x + (htic / 2), y + (vtic / 2));
1976 HPGL2_vector(x, y + vtic);
1977 HPGL2_vector(x - (htic / 2), y + (vtic / 2));
1978 fputs(";\n", gpoutfile);
1980 fprintf(gpoutfile, "PM0;\n");
1982 HPGL2_vector(x - (htic / 2), y - (vtic / 2));
1983 HPGL2_vector(x - htic, y);
1984 HPGL2_vector(x - (htic / 2), y + (vtic / 2));
1985 fputs(";\n", gpoutfile);
1987 fprintf(gpoutfile, "PM2;FP;EP;\n");
1988 HPGL2_move(x - (htic / 2), y - (vtic / 2));
1989 HPGL2_vector(x, y - vtic);
1990 HPGL2_vector(x + (htic / 2), y - (vtic / 2));
1991 fputs(";\n", gpoutfile);
1993 fprintf(gpoutfile, "PM0;\n");
1995 HPGL2_vector(x + (htic / 2), y + (vtic / 2));
1996 HPGL2_vector(x + htic, y);
1997 HPGL2_vector(x + (htic / 2), y - (vtic / 2));
1998 fputs(";\n", gpoutfile);
2000 fprintf(gpoutfile, "PM2;FP;EP;\n");
2002 case 58: /* semisolid diamond 11 */
2003 HPGL2_move(x - (htic / 2), y - (vtic / 2));
2004 HPGL2_vector(x, y - vtic);
2005 HPGL2_vector(x + (htic / 2), y - (vtic / 2));
2006 fputs(";\n", gpoutfile);
2008 fprintf(gpoutfile, "PM0;\n");
2010 HPGL2_vector(x - (htic / 2), y - (vtic / 2));
2011 HPGL2_vector(x - htic, y);
2012 HPGL2_vector(x, y + vtic);
2013 HPGL2_vector(x + htic, y);
2014 HPGL2_vector(x + (htic / 2), y - (vtic / 2));
2015 fputs(";\n", gpoutfile);
2017 fprintf(gpoutfile, "PM2;FP;EP;\n");
2019 case 59: /* semisolid diamond 12 */
2020 HPGL2_move(x + (htic / 2), y + (vtic / 2));
2021 HPGL2_vector(x, y + vtic);
2022 HPGL2_vector(x - htic, y);
2023 HPGL2_vector(x - (htic / 2), y - (vtic / 2));
2024 fputs(";\n", gpoutfile);
2026 fprintf(gpoutfile, "PM0;\n");
2027 HPGL2_vector(x + (htic / 2), y + (vtic / 2));
2028 HPGL2_vector(x + htic, y);
2029 HPGL2_vector(x, y - vtic);
2030 HPGL2_vector(x - (htic / 2), y - (vtic / 2));
2031 fputs(";\n", gpoutfile);
2033 fprintf(gpoutfile, "PM2;FP;EP;\n");
2035 case 60: /* semisolid diamond 13 */
2036 HPGL2_move(x - (htic / 2), y + (vtic / 2));
2037 HPGL2_vector(x - htic, y);
2038 HPGL2_vector(x - (htic / 2), y - (vtic / 2));
2039 fputs(";\n", gpoutfile);
2041 fprintf(gpoutfile, "PM0;\n");
2042 HPGL2_vector(x, y - vtic);
2043 HPGL2_vector(x + htic, y);
2044 HPGL2_vector(x, y + vtic);
2045 HPGL2_vector(x - (htic / 2), y + (vtic / 2));
2047 HPGL2_vector(x - (htic / 2), y - (vtic / 2));
2048 fputs(";\n", gpoutfile);
2050 fprintf(gpoutfile, "PM2;FP;EP;\n");
2052 case 61: /* semisolid diamond 14 */
2053 HPGL2_move(x + (htic / 2), y + (vtic / 2));
2054 HPGL2_vector(x, y + vtic);
2055 HPGL2_vector(x - (htic / 2), y + (vtic / 2));
2056 fputs(";\n", gpoutfile);
2058 fprintf(gpoutfile, "PM0;\n");
2059 HPGL2_vector(x - htic, y);
2060 HPGL2_vector(x, y - vtic);
2061 HPGL2_vector(x + htic, y);
2062 HPGL2_vector(x + (htic / 2), y + (vtic / 2));
2064 HPGL2_vector(x - (htic / 2), y + (vtic / 2));
2065 fputs(";\n", gpoutfile);
2067 fprintf(gpoutfile, "PM2;FP;EP;\n");
2069 case 62: /* solid diamond 2 */
2070 HPGL2_move(x - htic, y);
2071 fputs(";\n", gpoutfile);
2073 fprintf(gpoutfile, "PM0;\n");
2074 HPGL2_vector(x, y - vtic);
2075 HPGL2_vector(x + htic, y);
2076 HPGL2_vector(x, y + vtic);
2077 HPGL2_vector(x - htic, y);
2078 fputs(";\n", gpoutfile);
2080 fprintf(gpoutfile, "PM2;FP;EP;\n");
2082 case 63: /* hollow square 3 */
2083 HPGL2_move(x - (3 * htic / 4), y - (3 * vtic / 4));
2084 HPGL2_vector(x + (3 * htic / 4), y - (3 * vtic / 4));
2085 HPGL2_vector(x + (3 * htic / 4), y + (3 * vtic / 4));
2086 HPGL2_vector(x - (3 * htic / 4), y + (3 * vtic / 4));
2087 HPGL2_vector(x - (3 * htic / 4), y - (3 * vtic / 4));
2089 case 64: /* hollow circle 3 */
2091 fputs(";\n", gpoutfile);
2093 fprintf(gpoutfile, "CI%.2f;\n", ((double) 3 * (htic) / 4));
2095 case 65: /* hollow triangle 3 */
2096 HPGL2_move(x, y + (3 * vtic / 4));
2097 HPGL2_vector(x - (3 * sqrt(3) * htic / 8), y - (3 * vtic / 8));
2098 HPGL2_vector(x + (3 * sqrt(3) * htic / 8), y - (3 * vtic / 8));
2099 HPGL2_vector(x, y + (3 * vtic / 4));
2101 case 66: /* hollow triangle 4 */
2102 HPGL2_move(x, y - (3 * vtic / 4));
2103 HPGL2_vector(x - (3 * sqrt(3) * htic / 8), y + (3 * vtic / 8));
2104 HPGL2_vector(x + (3 * sqrt(3) * htic / 8), y + (3 * vtic / 8));
2105 HPGL2_vector(x, y - (3 * vtic / 4));
2107 case 67: /* hollow diamond 3 */
2108 HPGL2_move(x - (3 * htic / 4), y);
2109 HPGL2_vector(x, y - (3 * vtic / 4));
2110 HPGL2_vector(x + (3 * htic / 4), y);
2111 HPGL2_vector(x, y + (3 * vtic / 4));
2112 HPGL2_vector(x - (3 * htic / 4), y);
2114 case 68: /* hollow pentagon 2 */
2115 HPGL2_move(x, y + (3 * vtic / 4));
2116 HPGL2_vector(x - (cos(.1 * acos(-1)) * 3 * htic / 4), y + (sin(.1 * acos(-1)) * 3 * vtic / 4));
2117 HPGL2_vector(x - (sin(.2 * acos(-1)) * 3 * htic / 4), y - (cos(.2 * acos(-1)) * 3 * vtic / 4));
2118 HPGL2_vector(x + (sin(.2 * acos(-1)) * 3 * htic / 4), y - (cos(.2 * acos(-1)) * 3 * vtic / 4));
2119 HPGL2_vector(x + (cos(.1 * acos(-1)) * 3 * htic / 4), y + (sin(.1 * acos(-1)) * 3 * vtic / 4));
2120 HPGL2_vector(x, y + (3 * vtic / 4));
2122 case 69: /* opaque square */
2123 HPGL2_move(x - htic, y - vtic);
2124 fputs(";\n", gpoutfile);
2126 fprintf(gpoutfile, "FT10,30;RA%d,%d;EP;FT;\n", x + (3 * htic / 4), y + (3 * vtic / 4));
2128 case 70: /* opaque circle */
2130 fputs(";\n", gpoutfile);
2132 fprintf(gpoutfile, "FT10,30;WG%.2f,0,360;EP;FT;\n", ((double) 3 * (htic) / 4));
2134 case 71: /* opaque triangle 1 */
2135 HPGL2_move(x, y + (3 * vtic / 4));
2136 fputs(";\n", gpoutfile);
2138 fprintf(gpoutfile, "PM0;\n");
2139 HPGL2_vector(x - (3 * sqrt(3) * htic / 8), y - (3 * vtic / 8));
2140 HPGL2_vector(x + (3 * sqrt(3) * htic / 8), y - (3 * vtic / 8));
2141 HPGL2_vector(x, y + (3 * vtic / 4));
2142 fputs(";\n", gpoutfile);
2144 fprintf(gpoutfile, "PM2;FT10,30;FP;EP;FT;\n");
2146 case 72: /* opaque triangle 2 */
2147 HPGL2_move(x, y - (3 * vtic / 4));
2148 fputs(";\n", gpoutfile);
2150 fprintf(gpoutfile, "PM0;\n");
2151 HPGL2_vector(x - (3 * sqrt(3) * htic / 8), y + (3 * vtic / 8));
2152 HPGL2_vector(x + (3 * sqrt(3) * htic / 8), y + (3 * vtic / 8));
2153 HPGL2_vector(x, y - (3 * vtic / 4));
2154 fputs(";\n", gpoutfile);
2156 fprintf(gpoutfile, "PM2;FT10,30;FP;EP;FT;\n");
2158 case 73: /* opaque diamond */
2159 HPGL2_move(x - (3 * htic / 4), y);
2160 fputs(";\n", gpoutfile);
2162 fprintf(gpoutfile, "PM0;\n");
2163 HPGL2_vector(x, y - (3 * vtic / 4));
2164 HPGL2_vector(x + (3 * htic / 4), y);
2165 HPGL2_vector(x, y + (3 * vtic / 4));
2166 HPGL2_vector(x - (3 * htic / 4), y);
2167 fputs(";\n", gpoutfile);
2169 fprintf(gpoutfile, "PM2;FT10,30;FP;EP;FT;\n");
2171 case 74: /* opaque pentagon */
2172 HPGL2_move(x, y + (3 * vtic / 4));
2173 fputs(";\n", gpoutfile);
2175 fprintf(gpoutfile, "PM0;\n");
2176 HPGL2_vector(x - (cos(.1 * acos(-1)) * 3 * htic / 4), y + (sin(.1 * acos(-1)) * 3 * vtic / 4));
2177 HPGL2_vector(x - (sin(.2 * acos(-1)) * 3 * htic / 4), y - (cos(.2 * acos(-1)) * 3 * vtic / 4));
2178 HPGL2_vector(x + (sin(.2 * acos(-1)) * 3 * htic / 4), y - (cos(.2 * acos(-1)) * 3 * vtic / 4));
2179 HPGL2_vector(x + (cos(.1 * acos(-1)) * 3 * htic / 4), y + (sin(.1 * acos(-1)) * 3 * vtic / 4));
2180 HPGL2_vector(x, y + (3 * vtic / 4));
2181 fputs(";\n", gpoutfile);
2183 fprintf(gpoutfile, "PM2;FT10,30;FP;EP;FT;\n");
2187 } else { /* default style points */
2189 HPGL2_neg_point(x, y, number);
2191 htic = (int) (HPGL2_psize * PCL_HTIC / 2);
2192 vtic = (int) (HPGL2_psize * PCL_VTIC / 2);
2193 number %= HPGL2_NUM_NOPSPOINTS;
2195 case 0: /* diamond */
2196 HPGL2_move(x - htic, y);
2197 HPGL2_vector(x, y - vtic);
2198 HPGL2_vector(x + htic, y);
2199 HPGL2_vector(x, y + vtic);
2200 HPGL2_vector(x - htic, y);
2205 HPGL2_move(x - htic, y);
2206 HPGL2_vector(x - htic, y);
2207 HPGL2_vector(x + htic, y);
2208 HPGL2_move(x, y - vtic);
2209 HPGL2_vector(x, y - vtic);
2210 HPGL2_vector(x, y + vtic);
2213 HPGL2_move(x - htic, y - vtic);
2214 HPGL2_vector(x - htic, y - vtic);
2215 HPGL2_vector(x + htic, y - vtic);
2216 HPGL2_vector(x + htic, y + vtic);
2217 HPGL2_vector(x - htic, y + vtic);
2218 HPGL2_vector(x - htic, y - vtic);
2223 HPGL2_move(x - htic, y - vtic);
2224 HPGL2_vector(x - htic, y - vtic);
2225 HPGL2_vector(x + htic, y + vtic);
2226 HPGL2_move(x - htic, y + vtic);
2227 HPGL2_vector(x - htic, y + vtic);
2228 HPGL2_vector(x + htic, y - vtic);
2230 case 4: /* triangle */
2231 HPGL2_move(x, y + (4 * vtic / 3));
2232 HPGL2_vector(x - (4 * htic / 3), y - (2 * vtic / 3));
2233 HPGL2_vector(x + (4 * htic / 3), y - (2 * vtic / 3));
2234 HPGL2_vector(x, y + (4 * vtic / 3));
2239 HPGL2_move(x - htic, y);
2240 HPGL2_vector(x - htic, y);
2241 HPGL2_vector(x + htic, y);
2242 HPGL2_move(x, y - vtic);
2243 HPGL2_vector(x, y - vtic);
2244 HPGL2_vector(x, y + vtic);
2245 HPGL2_move(x - htic, y - vtic);
2246 HPGL2_vector(x - htic, y - vtic);
2247 HPGL2_vector(x + htic, y + vtic);
2248 HPGL2_move(x - htic, y + vtic);
2249 HPGL2_vector(x - htic, y + vtic);
2250 HPGL2_vector(x + htic, y - vtic);
2258 * This is for special purpose negative point types. If they are not needed,
2259 * they should be safely ignorable, but the special pointypes can be omitted
2260 * if necessary, leaving only the dot (which is -1).
2264 HPGL2_neg_point(unsigned int x, unsigned int y, int number)
2267 htic = (int) (HPGL2_psize * PCL_HTIC / 2);
2268 vtic = (int) (HPGL2_psize * PCL_VTIC / 2);
2270 case -20: /* well 18 */
2271 HPGL2_move(x - htic, y - vtic);
2272 HPGL2_vector(x + htic, y + vtic);
2274 fputs(";\n", gpoutfile);
2276 fprintf(gpoutfile, "CI%.2f;\n", ((double) 3 * (htic) / 4));
2278 case -19: /* well 17 */
2279 HPGL2_move(x, y - vtic);
2280 HPGL2_vector(x, y - (vtic / 2));
2281 HPGL2_move(x, y + (vtic / 2));
2282 HPGL2_vector(x, y + vtic);
2283 HPGL2_move(x, y - vtic);
2284 HPGL2_vector(x - (htic / 4), y - (3 * vtic / 4));
2285 HPGL2_move(x, y - vtic);
2286 HPGL2_vector(x + (htic / 4), y - (3 * vtic / 4));
2288 fputs(";\n", gpoutfile);
2290 fprintf(gpoutfile, "CI%.2f;\n", ((double) (htic) / 2));
2292 case -18: /* well 16 */
2293 HPGL2_move(x - htic, y);
2294 HPGL2_vector(x + htic, y);
2295 HPGL2_move(x, y - vtic);
2296 HPGL2_vector(x, y + vtic);
2298 fputs(";\n", gpoutfile);
2300 fprintf(gpoutfile, "CI%.2f;\n", ((double) 3 * (htic) / 4));
2302 case -17: /* well 15 */
2303 HPGL2_move(x - htic, y - vtic);
2304 HPGL2_vector(x - (3 * sqrt(2) * htic / 8), y - (3 * sqrt(2) * vtic / 8));
2305 HPGL2_move(x + (sqrt(2) * htic / 2), y - (sqrt(2) * vtic / 2));
2306 HPGL2_vector(x + (3 * sqrt(2) * htic / 8), y - (3 * sqrt(2) * vtic / 8));
2307 HPGL2_move(x + htic, y + vtic);
2308 HPGL2_vector(x + (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2309 HPGL2_move(x - (sqrt(2) * htic / 2), y + (sqrt(2) * vtic / 2));
2310 HPGL2_vector(x - (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2311 HPGL2_move(x - htic, y);
2312 HPGL2_vector(x - (3 * htic / 4), y);
2313 HPGL2_move(x + (3 * htic / 4), y);
2314 HPGL2_vector(x + htic, y);
2315 HPGL2_move(x, y - vtic);
2316 HPGL2_vector(x, y - (3 * vtic / 4));
2317 HPGL2_move(x, y + (3 * vtic / 4));
2318 HPGL2_vector(x, y + vtic);
2320 fputs(";\n", gpoutfile);
2322 fprintf(gpoutfile, "EW%.2f,0,180;\n", ((double) 3 * (htic) / 4));
2323 fprintf(gpoutfile, "WG%.2f,180,180;EP;\n", ((double) 3 * (htic) / 4));
2325 case -16: /* well 14 */
2326 HPGL2_move(x - htic, y - vtic);
2327 HPGL2_vector(x - (3 * sqrt(2) * htic / 8), y - (3 * sqrt(2) * vtic / 8));
2328 HPGL2_move(x + htic, y + vtic);
2329 HPGL2_vector(x + (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2330 HPGL2_move(x - (sqrt(2) * htic / 2), y + (sqrt(2) * vtic / 2));
2331 HPGL2_vector(x - (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2332 HPGL2_move(x - htic, y);
2333 HPGL2_vector(x - (3 * htic / 4), y);
2334 HPGL2_move(x + (3 * htic / 4), y);
2335 HPGL2_vector(x + htic, y);
2336 HPGL2_move(x, y + (3 * vtic / 4));
2337 HPGL2_vector(x, y + vtic);
2339 fputs(";\n", gpoutfile);
2341 fprintf(gpoutfile, "WG%.2f,0,360;EP;\n", ((double) 3 * (htic) / 4));
2343 case -15: /* well 13 */
2344 HPGL2_move(x - htic, y - vtic);
2345 HPGL2_vector(x - (3 * sqrt(2) * htic / 8), y - (3 * sqrt(2) * vtic / 8));
2346 HPGL2_move(x + (sqrt(2) * htic / 2), y - (sqrt(2) * vtic / 2));
2347 HPGL2_vector(x + (3 * sqrt(2) * htic / 8), y - (3 * sqrt(2) * vtic / 8));
2348 HPGL2_move(x + htic, y + vtic);
2349 HPGL2_vector(x + (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2350 HPGL2_move(x - (sqrt(2) * htic / 2), y + (sqrt(2) * vtic / 2));
2351 HPGL2_vector(x - (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2352 HPGL2_move(x - htic, y);
2353 HPGL2_vector(x - (3 * htic / 4), y);
2354 HPGL2_move(x + (3 * htic / 4), y);
2355 HPGL2_vector(x + htic, y);
2356 HPGL2_move(x, y - vtic);
2357 HPGL2_vector(x, y - (3 * vtic / 4));
2358 HPGL2_move(x, y + (3 * vtic / 4));
2359 HPGL2_vector(x, y + vtic);
2361 fputs(";\n", gpoutfile);
2363 fprintf(gpoutfile, "WG%.2f,0,360;EP;\n", ((double) 3 * (htic) / 4));
2365 case -14: /* well 12 */
2366 HPGL2_move(x - htic, y - vtic);
2367 HPGL2_vector(x - (3 * sqrt(2) * htic / 8), y - (3 * sqrt(2) * vtic / 8));
2368 HPGL2_move(x + (sqrt(2) * htic / 2), y - (sqrt(2) * vtic / 2));
2369 HPGL2_vector(x + (3 * sqrt(2) * htic / 8), y - (3 * sqrt(2) * vtic / 8));
2370 HPGL2_move(x + htic, y + vtic);
2371 HPGL2_vector(x + (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2372 HPGL2_move(x - (sqrt(2) * htic / 2), y + (sqrt(2) * vtic / 2));
2373 HPGL2_vector(x - (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2374 HPGL2_move(x - htic, y);
2375 HPGL2_vector(x - (3 * htic / 4), y);
2376 HPGL2_move(x + (3 * htic / 4), y);
2377 HPGL2_vector(x + htic, y);
2378 HPGL2_move(x, y - vtic);
2379 HPGL2_vector(x, y - (3 * vtic / 4));
2380 HPGL2_move(x, y + (3 * vtic / 4));
2381 HPGL2_vector(x, y + vtic);
2383 fputs(";\n", gpoutfile);
2385 fprintf(gpoutfile, "CI%.2f;\n", ((double) 3 * (htic) / 4));
2387 case -13: /* well 11 */
2388 HPGL2_move(x - htic, y - vtic);
2389 HPGL2_vector(x - (3 * sqrt(2) * htic / 8), y - (3 * sqrt(2) * vtic / 8));
2390 HPGL2_move(x + htic, y + vtic);
2391 HPGL2_vector(x + (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2393 fputs(";\n", gpoutfile);
2395 fprintf(gpoutfile, "WG%.2f,0,360;EP;\n", ((double) 3 * (htic) / 4));
2397 case -12: /* well 10 */
2398 HPGL2_move(x + (sqrt(2) * htic / 2), y + (sqrt(2) * vtic / 2));
2399 HPGL2_vector(x + (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2400 HPGL2_move(x - (sqrt(2) * htic / 2), y + (sqrt(2) * vtic / 2));
2401 HPGL2_vector(x - (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2402 HPGL2_move(x - htic, y);
2403 HPGL2_vector(x - (3 * htic / 4), y);
2404 HPGL2_move(x + (3 * htic / 4), y);
2405 HPGL2_vector(x + htic, y);
2406 HPGL2_move(x, y - vtic);
2407 HPGL2_vector(x, y - (3 * vtic / 4));
2408 HPGL2_move(x, y + (3 * vtic / 4));
2409 HPGL2_vector(x, y + vtic);
2411 fputs(";\n", gpoutfile);
2413 fprintf(gpoutfile, "EW%.2f,0,180;\n", ((double) 3 * (htic) / 4));
2414 fprintf(gpoutfile, "WG%.2f,180,180;EP;\n", ((double) 3 * (htic) / 4));
2416 case -11: /* well 9 */
2417 HPGL2_move(x + (sqrt(2) * htic / 2), y + (sqrt(2) * vtic / 2));
2418 HPGL2_vector(x + (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2419 HPGL2_move(x - (sqrt(2) * htic / 2), y + (sqrt(2) * vtic / 2));
2420 HPGL2_vector(x - (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2421 HPGL2_move(x - htic, y);
2422 HPGL2_vector(x - (3 * htic / 4), y);
2423 HPGL2_move(x + (3 * htic / 4), y);
2424 HPGL2_vector(x + htic, y);
2425 HPGL2_move(x, y - vtic);
2426 HPGL2_vector(x, y - (3 * vtic / 4));
2427 HPGL2_move(x, y + (3 * vtic / 4));
2428 HPGL2_vector(x, y + vtic);
2430 fputs(";\n", gpoutfile);
2432 fprintf(gpoutfile, "CI%.2f;\n", ((double) 3 * (htic) / 4));
2434 case -10: /* well 8 */
2435 HPGL2_move(x - htic, y);
2436 HPGL2_vector(x - (3 * htic / 4), y);
2437 HPGL2_move(x + (3 * htic / 4), y);
2438 HPGL2_vector(x + htic, y);
2439 HPGL2_move(x, y - vtic);
2440 HPGL2_vector(x, y - (3 * vtic / 4));
2441 HPGL2_move(x, y + (3 * vtic / 4));
2442 HPGL2_vector(x, y + vtic);
2444 fputs(";\n", gpoutfile);
2446 fprintf(gpoutfile, "EW%.2f,0,180;\n", ((double) 3 * (htic) / 4));
2447 fprintf(gpoutfile, "WG%.2f,180,180;EP;\n", ((double) 3 * (htic) / 4));
2449 case -9: /* well 7 */
2450 HPGL2_move(x - (sqrt(2) * htic / 2), y - (sqrt(2) * vtic / 2));
2451 HPGL2_vector(x - (3 * sqrt(2) * htic / 8), y - (3 * sqrt(2) * vtic / 8));
2452 HPGL2_move(x + (sqrt(2) * htic / 2), y - (sqrt(2) * vtic / 2));
2453 HPGL2_vector(x + (3 * sqrt(2) * htic / 8), y - (3 * sqrt(2) * vtic / 8));
2454 HPGL2_move(x + (sqrt(2) * htic / 2), y + (sqrt(2) * vtic / 2));
2455 HPGL2_vector(x + (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2456 HPGL2_move(x - (sqrt(2) * htic / 2), y + (sqrt(2) * vtic / 2));
2457 HPGL2_vector(x - (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2458 HPGL2_move(x - htic, y);
2459 HPGL2_vector(x - (3 * htic / 4), y);
2460 HPGL2_move(x + (3 * htic / 4), y);
2461 HPGL2_vector(x + htic, y);
2462 HPGL2_move(x, y - vtic);
2463 HPGL2_vector(x, y - (3 * vtic / 4));
2464 HPGL2_move(x, y + (3 * vtic / 4));
2465 HPGL2_vector(x, y + vtic);
2467 fputs(";\n", gpoutfile);
2469 fprintf(gpoutfile, "EW%.2f,0,180;\n", ((double) 3 * (htic) / 4));
2470 fprintf(gpoutfile, "WG%.2f,180,180;EP;\n", ((double) 3 * (htic) / 4));
2472 case -8: /* well 6 */
2473 HPGL2_move(x + (sqrt(2) * htic / 2), y + (sqrt(2) * vtic / 2));
2474 HPGL2_vector(x + (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2475 HPGL2_move(x - (sqrt(2) * htic / 2), y + (sqrt(2) * vtic / 2));
2476 HPGL2_vector(x - (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2477 HPGL2_move(x - htic, y);
2478 HPGL2_vector(x - (3 * htic / 4), y);
2479 HPGL2_move(x + (3 * htic / 4), y);
2480 HPGL2_vector(x + htic, y);
2481 HPGL2_move(x, y + (3 * vtic / 4));
2482 HPGL2_vector(x, y + vtic);
2484 fputs(";\n", gpoutfile);
2486 fprintf(gpoutfile, "WG%.2f,0,360;EP;\n", ((double) 3 * (htic) / 4));
2488 case -7: /* well 5 */
2489 HPGL2_move(x - (sqrt(2) * htic / 2), y - (sqrt(2) * vtic / 2));
2490 HPGL2_vector(x - (3 * sqrt(2) * htic / 8), y - (3 * sqrt(2) * vtic / 8));
2491 HPGL2_move(x + (sqrt(2) * htic / 2), y - (sqrt(2) * vtic / 2));
2492 HPGL2_vector(x + (3 * sqrt(2) * htic / 8), y - (3 * sqrt(2) * vtic / 8));
2493 HPGL2_move(x + (sqrt(2) * htic / 2), y + (sqrt(2) * vtic / 2));
2494 HPGL2_vector(x + (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2495 HPGL2_move(x - (sqrt(2) * htic / 2), y + (sqrt(2) * vtic / 2));
2496 HPGL2_vector(x - (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2497 HPGL2_move(x - htic, y);
2498 HPGL2_vector(x - (3 * htic / 4), y);
2499 HPGL2_move(x + (3 * htic / 4), y);
2500 HPGL2_vector(x + htic, y);
2501 HPGL2_move(x, y - vtic);
2502 HPGL2_vector(x, y - (3 * vtic / 4));
2503 HPGL2_move(x, y + (3 * vtic / 4));
2504 HPGL2_vector(x, y + vtic);
2506 fputs(";\n", gpoutfile);
2508 fprintf(gpoutfile, "WG%.2f,0,360;EP;\n", ((double) 3 * (htic) / 4));
2510 case -6: /* well 4 */
2511 HPGL2_move(x - (sqrt(2) * htic / 2), y - (sqrt(2) * vtic / 2));
2512 HPGL2_vector(x - (3 * sqrt(2) * htic / 8), y - (3 * sqrt(2) * vtic / 8));
2513 HPGL2_move(x + (sqrt(2) * htic / 2), y - (sqrt(2) * vtic / 2));
2514 HPGL2_vector(x + (3 * sqrt(2) * htic / 8), y - (3 * sqrt(2) * vtic / 8));
2515 HPGL2_move(x + (sqrt(2) * htic / 2), y + (sqrt(2) * vtic / 2));
2516 HPGL2_vector(x + (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2517 HPGL2_move(x - (sqrt(2) * htic / 2), y + (sqrt(2) * vtic / 2));
2518 HPGL2_vector(x - (3 * sqrt(2) * htic / 8), y + (3 * sqrt(2) * vtic / 8));
2519 HPGL2_move(x - htic, y);
2520 HPGL2_vector(x - (3 * htic / 4), y);
2521 HPGL2_move(x + (3 * htic / 4), y);
2522 HPGL2_vector(x + htic, y);
2523 HPGL2_move(x, y - vtic);
2524 HPGL2_vector(x, y - (3 * vtic / 4));
2525 HPGL2_move(x, y + (3 * vtic / 4));
2526 HPGL2_vector(x, y + vtic);
2528 fputs(";\n", gpoutfile);
2530 fprintf(gpoutfile, "CI%.2f;\n", ((double) 3 * (htic) / 4));
2532 case -5: /* well 3 */
2534 fputs(";\n", gpoutfile);
2536 fprintf(gpoutfile, "WG%.2f,0,360;EP;\n", ((double) 3 * (htic) / 4));
2538 case -4: /* well 2 */
2539 HPGL2_move(x - htic, y);
2540 HPGL2_vector(x - (3 * htic / 4), y);
2541 HPGL2_move(x + (3 * htic / 4), y);
2542 HPGL2_vector(x + htic, y);
2543 HPGL2_move(x, y - vtic);
2544 HPGL2_vector(x, y - (3 * vtic / 4));
2545 HPGL2_move(x, y + (3 * vtic / 4));
2546 HPGL2_vector(x, y + vtic);
2548 fputs(";\n", gpoutfile);
2550 fprintf(gpoutfile, "CI%.2f;\n", ((double) 3 * (htic) / 4));
2552 case -3: /* well 1 */
2554 fputs(";\n", gpoutfile);
2556 fprintf(gpoutfile, "CI%.2f;\n", ((double) 3 * (htic) / 4));
2558 case -2: /* v box */
2559 HPGL2_move(x - htic, y);
2560 HPGL2_vector(x - (3 * htic / 4), y);
2561 HPGL2_move(x + (3 * htic / 4), y);
2562 HPGL2_vector(x + htic, y);
2563 HPGL2_move(x, y - vtic);
2564 HPGL2_vector(x, y - (3 * vtic / 4));
2565 HPGL2_move(x, y + (3 * vtic / 4));
2566 HPGL2_vector(x, y + vtic);
2567 HPGL2_move(x - (3 * htic / 4), y - (3 * vtic / 4));
2568 HPGL2_vector(x + (3 * htic / 4), y - (3 * vtic / 4));
2569 HPGL2_vector(x + (3 * htic / 4), y + (3 * vtic / 4));
2570 HPGL2_vector(x - (3 * htic / 4), y + (3 * vtic / 4));
2571 HPGL2_vector(x - (3 * htic / 4), y - (3 * vtic / 4));
2572 HPGL2_move(x - (htic / 2), y + (vtic / 2));
2573 HPGL2_vector(x, y - (vtic / 2));
2574 HPGL2_vector(x + (htic / 2), y + (vtic / 2));
2585 HPGL2_pointsize(double size)
2587 HPGL2_psize = (size >= 0 ? size : 1);
2590 #endif /* TERM_BODY */
2593 TERM_TABLE_START(hpgl_driver)
2594 "hpgl", "HP7475 and relatives [number of pens] [eject]",
2595 HPGL_XMAX, HPGL_YMAX, HPGL_VCHAR, HPGL_HCHAR,
2596 HPGL_VTIC, HPGL_HTIC, HPGL_options, HPGL_init, HPGL_reset,
2597 HPGL_text, null_scale, HPGL_graphics, HPGL_move, HPGL_vector,
2598 HPGL_linetype, HPGL_put_text, HPGL_text_angle, null_justify_text, do_point, do_arrow, set_font_null TERM_TABLE_END(hpgl_driver)
2600 #define LAST_TERM hpgl_driver
2601 TERM_TABLE_START(pcl5_driver)
2602 "pcl5", "HP Designjet 750C, HP Laserjet III/IV, etc. (many options)",
2603 PCL_XMAX, PCL_YMAX, HPGL2_VCHAR, HPGL2_HCHAR,
2604 PCL_VTIC, PCL_HTIC, PCL_options, PCL_init, PCL_reset,
2605 PCL_text, null_scale, PCL_graphics, HPGL2_move, HPGL2_vector,
2606 HPGL2_linetype, HPGL2_put_text, HPGL2_text_angle,
2607 HPGL2_justify_text, HPGL2_point, do_arrow, HPGL2_set_font, HPGL2_pointsize TERM_TABLE_END(pcl5_driver)
2609 #define LAST_TERM pcl5_driver
2610 #endif /* TERM_TABLE */
2611 #endif /* TERM_PROTO_ONLY */
2615 "?commands set terminal hpgl",
2616 "?set terminal hpgl",
2621 "?commands set terminal pcl5",
2622 "?set terminal pcl5",
2627 " The `hpgl` driver produces HPGL output for devices like the HP7475A plotter.",
2628 " There are two options which can be set: the number of pens and `eject`,",
2629 " which tells the plotter to eject a page when done. The default is to use 6",
2630 " pens and not to eject the page when done.",
2632 " The international character sets ISO-8859-1 and CP850 are recognized via",
2633 " `set encoding iso_8859_1` or `set encoding cp850` (see `set encoding` for",
2637 " set terminal hpgl {<number_of_pens>} {eject}",
2641 " set terminal hpgl 8 eject",
2643 " is equivalent to the previous `hp7550` terminal, and the selection",
2645 " set terminal hpgl 4",
2647 " is equivalent to the previous `hp7580b` terminal.",
2649 " The `pcl5` driver supports plotters such as the Hewlett-Packard Designjet",
2650 " 750C, the Hewlett-Packard Laserjet III, and the Hewlett-Packard Laserjet IV.",
2651 " It actually uses HPGL-2, but there is a name conflict among the terminal",
2652 " devices. It has several options which must be specified in the order",
2653 " indicated below:",
2656 " set terminal pcl5 {mode <mode>} {<plotsize>}",
2657 " {{color {<number_of_pens>}} | monochrome} {solid | dashed}",
2658 " {font <font>} {size <fontsize>} {pspoints | nopspoints}",
2660 " <mode> is `landscape` or `portrait`. <plotsize> is the physical",
2661 " plotting size of the plot, which is one of the following: `letter` for",
2662 " standard (8 1/2\" X 11\") displays, `legal` for (8 1/2\" X 14\") displays,",
2663 " `noextended` for (36\" X 48\") displays (a letter size ratio) or,",
2664 " `extended` for (36\" X 55\") displays (almost a legal size ratio).",
2665 " `color` is for multi-pen (i.e. color) plots, and <number_of_pens> is",
2666 " the number of pens (i.e. colors) used in color plots. `monochrome` is for",
2667 " one (e.g. black) pen plots. `solid` draws all lines as solid lines, or",
2668 " `dashed` will draw lines with different dashed and dotted line patterns.",
2669 " <font> is `stick`, `univers`, `cg_times`, `zapf_dingbats`, `antique_olive`,",
2670 " `arial`, `courier`, `garamond_antigua`, `letter_gothic`, `cg_omega`,",
2671 " `albertus`, `times_new_roman`, `clarendon`, `coronet`, `marigold`,",
2672 " `truetype_symbols`, or `wingdings`. <fontsize> is the font size in points.",
2673 " The point type selection can be the standard default set by specifying",
2674 " `nopspoints`, or the same set of point types found in the postscript terminal",
2675 " by specifying `pspoints`.",
2677 " Note that built-in support of some of these options is printer device",
2678 " dependent. For instance, all the fonts are supposedly supported by the HP",
2679 " Laserjet IV, but only a few (e.g. univers, stick) may be supported by the HP",
2680 " Laserjet III and the Designjet 750C. Also, color obviously won't work on the",
2681 " the laserjets since they are monochrome devices.",
2683 " Defaults: landscape, noextended, color (6 pens), solid, univers, 12 point,",
2686 " With `pcl5` international characters are handled by the printer; you just put",
2687 " the appropriate 8-bit character codes into the text strings. You don't need",
2688 " to bother with `set encoding`.",
2690 " HPGL graphics can be imported by many software packages."
2692 #endif /* TERM_HELP */