1 /* Hello, Emacs, this is -*-C-*-
2 * $Id: kyo.trm,v 1.12 2006/07/21 02:35:47 sfeam Exp $
6 /* Prescribe (KYOCERA) driver - Michael Waldor */
9 * Copyright 1990 - 1993, 1998, 2004
11 * Permission to use, copy, and distribute this software and its
12 * documentation for any purpose with or without fee is hereby granted,
13 * provided that the above copyright notice appear in all copies and
14 * that both that copyright notice and this permission notice appear
15 * in supporting documentation.
17 * Permission to modify the software is granted, but not the right to
18 * distribute the complete modified source code. Modifications are to
19 * be distributed as patches to the released version. Permission to
20 * distribute binaries produced by compiling modified sources is granted,
22 * 1. distribute the corresponding source modifications from the
23 * released version in the form of a patch file along with the binaries,
24 * 2. add special version identification to distinguish your version
25 * in addition to the base release version number,
26 * 3. provide your name and address as the primary contact for the
27 * support of your modified version, and
28 * 4. retain our contact information in regard to use of the base
30 * Permission to distribute the released version of the source code along
31 * with corresponding source modifications in the form of a patch file is
32 * granted with same provisions 2 through 4 for binary distributions.
34 * This software is provided "as is" without express or implied warranty
35 * to the extent permitted by applicable law.
38 /* Modified for gnuplot 2.0 sk@sun4 24-Apr-1990 13:23 */
41 * adapted to the new terminal layout by Stefan Bodewig (Dec. 1995)
47 register_term(prescribe)
52 TERM_PUBLIC void PRE_init __PROTO((void));
53 TERM_PUBLIC void KYO_init __PROTO((void));
54 TERM_PUBLIC void PRE_graphics __PROTO((void));
55 TERM_PUBLIC void PRE_text __PROTO((void));
56 TERM_PUBLIC void PRE_linetype __PROTO((int linetype));
57 TERM_PUBLIC void PRE_move __PROTO((unsigned int x, unsigned int y));
58 TERM_PUBLIC void PRE_vector __PROTO((unsigned int x, unsigned int y));
59 TERM_PUBLIC void PRE_put_text __PROTO((unsigned int x, unsigned int y, const char *str));
60 TERM_PUBLIC int PRE_justify_text __PROTO((enum JUSTIFY mode));
61 TERM_PUBLIC void PRE_reset __PROTO((void));
64 #define PRE_YMAX 1815 /* X:Y = sqrt(2) */
66 #define PRE_VCHAR (PRE_YMAX/30)
67 #define PRE_HCHAR 33 /* about 9 chars per inch */
68 #define PRE_HTIC (PRE_XMAX/80)
69 #define PRE_VTIC PRE_HTIC
71 /* for Courier font: */
72 #define KYO_VCHAR (14*(300/72)) /* 12 pt + 2 pt baselineskip */
73 #define KYO_HCHAR (300/10) /* 10 chars per inch */
74 #endif /* TERM_PROTO */
76 #ifndef TERM_PROTO_ONLY
79 #define PRE_XLAST (PRE_XMAX - 1)
80 #define PRE_YLAST (PRE_YMAX - 1)
82 enum JUSTIFY pre_justify = LEFT; /* text is flush left */
87 fputs("!R! RES;\n", gpoutfile);
88 /* UNIT: units are dots, 300 dots = 1 in = 72 pt */
89 /* SPO: landscape format */
90 /* STM, SLM set top, left margin */
91 /* Font: bold Helvetica (proportional font) */
92 fputs("PAGE; UNIT D; SPO L; STM 280; SLM 440;\n", gpoutfile);
93 fputs("FTMD 15; FONT 29; SCPI 9;\n", gpoutfile);
99 fputs("!R! RES;\n", gpoutfile);
100 /* UNIT: units are dots, 300 dots = 1 in = 72 pt */
101 /* SPO: landscape format */
102 /* STM, SLM set top, left margin */
103 /* Font: Courier (fixed width font) */
104 fputs("PAGE; UNIT D; SPO L; STM 280; SLM 440;\n", gpoutfile);
105 fputs("FTMD 15; FONT 17; SCPI 10;\n", gpoutfile);
115 { /* eject page after each plot */
116 fputs("PAGE;\n", gpoutfile);
120 PRE_linetype(int linetype)
122 /* actually choose pendiameter */
124 linetype = -linetype;
127 (void) fprintf(gpoutfile, "SPD %d;\n", linetype);
131 PRE_move(unsigned int x, unsigned int y)
133 (void) fprintf(gpoutfile, "MAP %1d,%1d;\n", x, PRE_YMAX - y);
137 PRE_vector(unsigned int x, unsigned int y)
139 (void) fprintf(gpoutfile, "DAP %1d, %1d;\n", x, PRE_YMAX - y);
143 PRE_put_text(unsigned int x, unsigned int y, const char *str)
146 switch (pre_justify) {
148 (void) fprintf(gpoutfile, "RTXT \"%s\", B;\n", str);
151 (void) fprintf(gpoutfile, "TEXT \"%s\", B;\n", str);
156 PRE_justify_text(enum JUSTIFY mode)
159 switch (pre_justify) {
172 fputs("PAGE; RES; EXIT;\n", gpoutfile);
175 #endif /* TERM_BODY */
178 TERM_TABLE_START(prescribe_driver)
179 "prescribe", "Prescribe - for the Kyocera Laser Printer",
180 PRE_XMAX, PRE_YMAX, PRE_VCHAR, PRE_HCHAR,
181 PRE_VTIC, PRE_HTIC, options_null, PRE_init, PRE_reset,
182 PRE_text, null_scale, PRE_graphics, PRE_move, PRE_vector,
183 PRE_linetype, PRE_put_text, null_text_angle,
184 PRE_justify_text, line_and_point, do_arrow, set_font_null
185 TERM_TABLE_END(prescribe_driver)
188 #define LAST_TERM prescribe_driver
190 TERM_TABLE_START(kyo_driver)
191 "kyo", "Kyocera Laser Printer with Courier font",
192 PRE_XMAX, PRE_YMAX, KYO_VCHAR, KYO_HCHAR,
193 PRE_VTIC, PRE_HTIC, options_null, KYO_init, PRE_reset,
194 PRE_text, null_scale, PRE_graphics, PRE_move, PRE_vector,
195 PRE_linetype, PRE_put_text, null_text_angle,
196 PRE_justify_text, line_and_point, do_arrow, set_font_null
197 TERM_TABLE_END(kyo_driver)
200 #define LAST_TERM kyo_driver
202 #endif /* TERM_TABLE */
203 #endif /* TERM_PROTO_ONLY */
208 "?commands set terminal kyo",
214 "?commands set terminal prescribe",
215 "?set terminal prescribe",
216 "?set term prescribe",
217 "?terminal prescribe",
220 " The `kyo` and `prescribe` terminal drivers support the Kyocera laser printer.",
221 " The only difference between the two is that `kyo` uses \"Helvetica\" whereas",
222 " `prescribe` uses \"Courier\". There are no options."