1 /*****************************************************************************
2 ** This is part of the CTSim program
3 ** Copyright (C) 1983-2000 Kevin Rosenberg
5 ** $Id: sgptext.cpp,v 1.2 2000/06/19 19:04:05 kevin Exp $
7 ** This program is free software; you can redistribute it and/or modify
8 ** it under the terms of the GNU General Public License (version 2) as
9 ** published by the Free Software Foundation.
11 ** This program is distributed in the hope that it will be useful,
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ** GNU General Public License for more details.
16 ** You should have received a copy of the GNU General Public License
17 ** along with this program; if not, write to the Free Software
18 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 ******************************************************************************/
22 * sgptext.c Text routines for graphics package
26 #include "ctsupport.h"
30 /* Pixel patterns of marker symbols (1x1 to 5x5 matrix) */
31 char MARKER[NMARKERS][5] = {
32 { '\0', '\0', '\010', '\0', '\0'}, /* small dot */
33 { '\0', '\034', '\024', '\034', '\0'}, /* empty square */
34 { '\0', '\034', '\034', '\034', '\0'}, /* filled square */
35 { '\0', '\010', '\024', '\010', '\0'}, /* empty diamond */
36 { '\0', '\010', '\034', '\010', '\0'}, /* filled diamond */
37 { '\010', '\010', '\076', '\010', '\010'}, /* cross */
38 { '\0', '\024', '\010', '\024', '\0'}, /* x */
39 { '\034', '\042', '\042', '\042', '\034'}, /* open circle */
40 { '\034', '\076', '\076', '\076', '\034'}, /* filled circle */
41 { '\076', '\042', '\042', '\042', '\076'}, /* big open square */
42 { '\010', '\024', '\042', '\024', '\010'}}; /* big open diamond */
44 /* WRTSYMBOL (sym, x, y, dev)
46 * puts marker symbols on the screen
47 * input in screen pixels
55 int y, /* Coordinates in screen pixels */
62 * WRTCHAR(<CH>, <X>, <Y>, cspec, dev)
64 * puts marker symbols on the screen
65 * input in screen pixels
66 * Calls: dot(), peek()
71 int ch, /* Character to be put on the screen */
73 int y, /* Coordinates in screen pixels of lower left corner*/
83 * prints a string starting from current position writing in the current
84 * printing direction (at right angle to the character direction)
85 * The pen is return to the original position.
89 wrttext (char txtstr[], int x, int y, CHARSPEC *cspec, DEVICE *dev)
100 crtcolor (int mode, int *f, int *b)