Artifact f376908d5bdd7c3ab5088bf74597fd1426e93f44d6df608e280129713570a894:


/*
 * $Id: qms.trm,v 3.26 92/03/24 22:35:41 woo Exp Locker: woo $
 */

/* GNUPLOT - qms.trm */
/*
 * Copyright (C) 1990, 1991, 1992   
 *
 * Permission to use, copy, and distribute this software and its
 * documentation for any purpose with or without fee is hereby granted, 
 * provided that the above copyright notice appear in all copies and 
 * that both that copyright notice and this permission notice appear 
 * in supporting documentation.
 *
 * Permission to modify the software is granted, but not the right to
 * distribute the modified code.  Modifications are to be distributed 
 * as patches to released version.
 *  
 * This software  is provided "as is" without express or implied warranty.
 * 
 * This file is included by ../term.c.
 *
 * This terminal driver supports:
 *  QMS laser printers
 *
 * AUTHORS
 *  Colin Kelley, Thomas Williams, Russell Lang
 * 
 * send your comments or suggestions to (info-gnuplot@ames.arc.nasa.gov).
 * 
 */

#define QMS_XMAX 9000
#define QMS_YMAX 6000

#define QMS_XLAST (QMS_XMAX - 1)
#define QMS_YLAST (QMS_YMAX - 1)

#define QMS_VCHAR		120
#define QMS_HCHAR		70
#define QMS_VTIC		70
#define QMS_HTIC		70

int qms_line = 0;	/* to remember current line type */

QMS_init()
{
/* This was just ^IOL, but at Rutgers at least we need some more stuff */
  fprintf(outfile,"^PY^-\n^IOL\n^ISYNTAX00000^F^IB11000^IJ00000^IT00000\n");
/*                 ^ QUIC on    ^set defaults  ^ set botttom,top,left margins
                          ^landscape         ^free format   */
/* set defaults are: implicit decimal point, units in inches, 
   numbers left justified, units in 1/1000 inch, do not ignore spaces */
/* margins are in 1/1000 inch units */
}


QMS_graphics()
{
	fprintf(outfile,"^IGV\n");
/*	                 ^enter graphics vector mode */
}



QMS_text()
{
/* added ^-, because ^, after an ^I command doesn't actually print a page */
/* Did anybody try this code out?  [uhh...-cdk] */
	fprintf(outfile,"^IGE\n^-^,");
/*	                 ^exit graphics vector mode
	                       ^pass terminator
	                         ^print page  */
}


QMS_linetype(linetype)
int linetype;
{
static int width[2+9] = {7, 3, 3, 3, 3, 5, 5, 5, 7, 7, 7};
static int type[2+9] =  {0, 1, 0, 2, 3, 0, 2, 3, 0, 2, 3};
/*
 * I don't know about Villanova, but on our printer, using ^V without
 * previously setting up a pattern crashes the microcode.
 * [nope, doesn't crash here. -cdk]
 * [it generates a controller error here on dotted lines. - rjl]
 */
/* Code to define patterns added by rjl
 * According to the manual it should work - but it doesn't
 */
	qms_line = linetype;
	if (linetype >= 9)
		linetype %= 9;
	fprintf(outfile,"^PW%02d\n",width[linetype+2]); 
/*	                 ^width in dots */
	switch (type[linetype+2]) {
		case 1 :	/* short dash */
			fprintf(outfile,"^PV102025^G\n^V1\n");
/* ^PV = define pattern vector, 1 = pattern number,
   02 = number of pen downs and ups, 025 = .025" length of ups/downs */
			break;
		case 2 :	/* medium dash */
			fprintf(outfile,"^PV202050^G\n^V2\n");
			break;
		case 3 :	/* long dash */
			fprintf(outfile,"^PV302100^G\n^V3\n");
			break;
		default:
		case 0 :
			fprintf(outfile,"^V0\n");
			break;
	}
}


QMS_move(x,y)
int x,y;
{
	fprintf(outfile,"^U%05d:%05d\n", 1000 + x, QMS_YLAST + 1000 - y);
/*	                 ^pen up vector*/
}


QMS_vector(x2,y2)
int x2,y2;
{
	fprintf(outfile,"^D%05d:%05d\n", 1000 + x2, QMS_YLAST + 1000 - y2);
/*	                 ^pen down vector*/
}


QMS_put_text(x,y,str)
unsigned int x,y;
char str[];
{
char ch;
	QMS_move(x,y + QMS_VCHAR/3);
	fputs("^IGE\n",outfile);
	ch = *str++;
	while(ch!='\0') {
		if (ch=='^')
			putc('^',outfile);
		putc(ch,outfile);
		ch = *str++;
	}
	fputs("\n^IGV\n",outfile);
	QMS_linetype(qms_line); /* restore line type */
}


QMS_reset()
{
	fprintf(outfile,"^PN^-\n");
/*	                 ^QUIC off*/
}



REDUCE Historical
REDUCE Sourceforge Project | Historical SVN Repository | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]