Annotation of OpenXM_contrib/gnuplot/bitmap.c, Revision 1.1.1.3
1.1 maekawa 1: #ifndef lint
1.1.1.3 ! ohara 2: static char *RCSid = "$Id: bitmap.c,v 1.2.2.4 2002/01/31 21:18:21 lhecking Exp $";
1.1 maekawa 3: #endif
4:
5: /* GNUPLOT - bitmap.c */
6:
7: /*[
8: * Copyright 1986 - 1993, 1998 Thomas Williams, Colin Kelley
9: *
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.
15: *
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,
20: * provided you
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
28: * software.
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.
32: *
33: * This software is provided "as is" without express or implied warranty
34: * to the extent permitted by applicable law.
35: ]*/
36:
37:
38: /*
39: * AUTHORS
40: *
41: * Original Software:
42: * Jyrki Yli-Nokari <jty@intrin.UUCP>
43: * Ronald J. Hartranft <rjh2@ns.cc.lehigh.edu>
44: * Russell Lang <rjl@monu1.cc.monash.edu.au>
45: */
46:
47:
48: /*
49: ** General raster plotting routines.
50: ** Raster routines written and copyrighted 1987 by
51: ** Jyrki Yli-Nokari (jty@intrin.UUCP)
52: ** Intrinsic, Ltd.
53: **
54: ** You may use this code for anything you like as long as
55: ** you are not selling it and the credit is given and
56: ** this message retained.
57: **
58: */
59:
60: /* Bitmap plotting routines derived from above raster plotting routines
61: * Russell Lang, 1990
62: */
63:
64: #include "plot.h"
65: #include "bitmap.h"
66:
67: /* forward decls */
68:
69: static void b_putc __PROTO((unsigned int, unsigned int, int, unsigned int));
70:
71: bitmap *b_p = (bitmap *) NULL; /* global pointer to bitmap */
72: unsigned int b_currx, b_curry; /* the current coordinates */
73: unsigned int b_xsize, b_ysize; /* the size of the bitmap */
74: unsigned int b_planes; /* number of color planes */
75: unsigned int b_psize; /* size of each plane */
76: unsigned int b_rastermode; /* raster mode rotates -90deg */
77: unsigned int b_linemask = 0xffff; /* 16 bit mask for dotted lines */
78: unsigned int b_value = 1; /* colour of lines */
79: unsigned int b_hchar; /* width of characters */
80: unsigned int b_hbits; /* actual bits in char horizontally */
81: unsigned int b_vchar; /* height of characters */
82: unsigned int b_vbits; /* actual bits in char vertically */
83: unsigned int b_angle; /* rotation of text */
84: char_box b_font[FNT_CHARS]; /* the current font */
85: unsigned int b_pattern[] =
86: {0xffff, 0x1111,
87: 0xffff, 0x5555, 0x3333, 0x7777, 0x3f3f, 0x0f0f, 0x5f5f};
88: int b_maskcount = 0;
89: unsigned int b_lastx, b_lasty; /* last pixel set - used by b_line */
90:
91: #define IN(i,size) ((unsigned)i < (unsigned)size)
92:
93: /* 5x9 font, bottom row first, left pixel in lsb */
94: char_row GPFAR fnt5x9[FNT_CHARS][FNT5X9_VBITS] = {
95: /* */ {000000,000000,000000,000000,000000,000000,000000,000000,000000},
96: /*!*/ {000000,000000,0x0004,000000,0x0004,0x0004,0x0004,0x0004,0x0004},
97: /*"*/ {000000,000000,000000,000000,000000,000000,0x000a,0x000a,0x000a},
98: /*#*/ {000000,000000,0x000a,0x000a,0x001f,0x000a,0x001f,0x000a,0x000a},
99: /*$*/ {000000,000000,0x0004,0x000f,0x0014,0x000e,0x0005,0x001e,0x0004},
100: /*%*/ {000000,000000,0x0018,0x0019,0x0002,0x0004,0x0008,0x0013,0x0003},
101: /*&*/ {000000,000000,0x0016,0x0009,0x0015,0x0002,0x0005,0x0005,0x0002},
102: /*'*/ {000000,000000,000000,000000,000000,0x0002,0x0004,0x0006,0x0006},
103: /*(*/ {000000,000000,0x0008,0x0004,0x0002,0x0002,0x0002,0x0004,0x0008},
104: /*)*/ {000000,000000,0x0002,0x0004,0x0008,0x0008,0x0008,0x0004,0x0002},
105: /***/ {000000,000000,0x0004,0x0015,0x000e,0x001f,0x000e,0x0015,0x0004},
106: /*+*/ {000000,000000,000000,0x0004,0x0004,0x001f,0x0004,0x0004,000000},
107: /*,*/ {000000,0x0002,0x0004,0x0006,0x0006,000000,000000,000000,000000},
108: /*-*/ {000000,000000,000000,000000,000000,0x001f,000000,000000,000000},
109: /*.*/ {000000,000000,0x0006,0x0006,000000,000000,000000,000000,000000},
110: /*-/-*/{000000,000000,000000,0x0001,0x0002,0x0004,0x0008,0x0010,000000},
111: /*0*/ {000000,000000,0x000e,0x0011,0x0013,0x0015,0x0019,0x0011,0x000e},
112: /*1*/ {000000,000000,0x000e,0x0004,0x0004,0x0004,0x0004,0x0006,0x0004},
113: /*2*/ {000000,000000,0x001f,0x0001,0x0001,0x000e,0x0010,0x0011,0x000e},
114: /*3*/ {000000,000000,0x000e,0x0011,0x0010,0x000c,0x0010,0x0011,0x000e},
115: /*4*/ {000000,000000,0x0008,0x0008,0x001f,0x0009,0x000a,0x000c,0x0008},
116: /*5*/ {000000,000000,0x000e,0x0011,0x0010,0x0010,0x000f,0x0001,0x001f},
117: /*6*/ {000000,000000,0x000e,0x0011,0x0011,0x000f,0x0001,0x0002,0x000c},
118: /*7*/ {000000,000000,0x0001,0x0001,0x0002,0x0004,0x0008,0x0010,0x001f},
119: /*8*/ {000000,000000,0x000e,0x0011,0x0011,0x000e,0x0011,0x0011,0x000e},
120: /*9*/ {000000,000000,0x0006,0x0008,0x0010,0x001e,0x0011,0x0011,0x000e},
121: /*:*/ {000000,000000,000000,0x0006,0x0006,000000,0x0006,0x0006,000000},
122: /*;*/ {000000,0x0001,0x0002,0x0006,0x0006,000000,0x0006,0x0006,000000},
123: /*<*/ {000000,000000,0x0008,0x0004,0x0002,0x0001,0x0002,0x0004,0x0008},
124: /*=*/ {000000,000000,000000,000000,0x001f,000000,0x001f,000000,000000},
125: /*>*/ {000000,000000,0x0002,0x0004,0x0008,0x0010,0x0008,0x0004,0x0002},
126: /*?*/ {000000,000000,0x0004,000000,0x0004,0x0008,0x0010,0x0011,0x000e},
127: /*@*/ {000000,000000,0x000e,0x0015,0x0015,0x0016,0x0010,0x0011,0x000e},
128: /*A*/ {000000,000000,0x0011,0x0011,0x001f,0x0011,0x0011,0x000a,0x0004},
129: /*B*/ {000000,000000,0x000f,0x0012,0x0012,0x000e,0x0012,0x0012,0x000f},
130: /*C*/ {000000,000000,0x000e,0x0011,0x0001,0x0001,0x0001,0x0011,0x000e},
131: /*D*/ {000000,000000,0x000f,0x0012,0x0012,0x0012,0x0012,0x0012,0x000f},
132: /*E*/ {000000,000000,0x001f,0x0001,0x0001,0x0007,0x0001,0x0001,0x001f},
133: /*F*/ {000000,000000,0x0001,0x0001,0x0001,0x0007,0x0001,0x0001,0x001f},
134: /*G*/ {000000,000000,0x001e,0x0011,0x0011,0x0019,0x0001,0x0001,0x001e},
135: /*H*/ {000000,000000,0x0011,0x0011,0x0011,0x001f,0x0011,0x0011,0x0011},
136: /*I*/ {000000,000000,0x000e,0x0004,0x0004,0x0004,0x0004,0x0004,0x000e},
137: /*J*/ {000000,000000,0x000e,0x0011,0x0010,0x0010,0x0010,0x0010,0x0010},
138: /*K*/ {000000,000000,0x0011,0x0009,0x0005,0x0003,0x0005,0x0009,0x0011},
139: /*L*/ {000000,000000,0x001f,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001},
140: /*M*/ {000000,000000,0x0011,0x0011,0x0011,0x0015,0x0015,0x001b,0x0011},
141: /*N*/ {000000,000000,0x0011,0x0011,0x0011,0x0019,0x0015,0x0013,0x0011},
142: /*O*/ {000000,000000,0x000e,0x0011,0x0011,0x0011,0x0011,0x0011,0x000e},
143: /*P*/ {000000,000000,0x0001,0x0001,0x0001,0x000f,0x0011,0x0011,0x000f},
144: /*Q*/ {000000,0x0018,0x000e,0x0015,0x0011,0x0011,0x0011,0x0011,0x000e},
145: /*R*/ {000000,000000,0x0011,0x0009,0x0005,0x000f,0x0011,0x0011,0x000f},
146: /*S*/ {000000,000000,0x000e,0x0011,0x0010,0x000e,0x0001,0x0011,0x000e},
147: /*T*/ {000000,000000,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x001f},
148: /*U*/ {000000,000000,0x000e,0x0011,0x0011,0x0011,0x0011,0x0011,0x0011},
149: /*V*/ {000000,000000,0x0004,0x0004,0x000a,0x000a,0x0011,0x0011,0x0011},
150: /*W*/ {000000,000000,0x0011,0x001b,0x0015,0x0011,0x0011,0x0011,0x0011},
151: /*X*/ {000000,000000,0x0011,0x0011,0x000a,0x0004,0x000a,0x0011,0x0011},
152: /*Y*/ {000000,000000,0x0004,0x0004,0x0004,0x0004,0x000a,0x0011,0x0011},
153: /*Z*/ {000000,000000,0x001f,0x0001,0x0002,0x0004,0x0008,0x0010,0x001f},
154: /*[*/ {000000,000000,0x000e,0x0002,0x0002,0x0002,0x0002,0x0002,0x000e},
155: /*\*/ {000000,000000,000000,0x0010,0x0008,0x0004,0x0002,0x0001,000000},
156: /*]*/ {000000,000000,0x000e,0x0008,0x0008,0x0008,0x0008,0x0008,0x000e},
157: /*^*/ {000000,000000,000000,000000,000000,000000,0x0011,0x000a,0x0004},
158: /*_*/ {000000,000000,0x001f,000000,000000,000000,000000,000000,000000},
159: /*`*/ {000000,000000,000000,000000,000000,0x0008,0x0004,0x000c,0x000c},
160: /*a*/ {000000,000000,0x001e,0x0011,0x001e,0x0010,0x000e,000000,000000},
161: /*b*/ {000000,000000,0x000d,0x0013,0x0011,0x0013,0x000d,0x0001,0x0001},
162: /*c*/ {000000,000000,0x000e,0x0011,0x0001,0x0011,0x000e,000000,000000},
163: /*d*/ {000000,000000,0x0016,0x0019,0x0011,0x0019,0x0016,0x0010,0x0010},
164: /*e*/ {000000,000000,0x000e,0x0001,0x001f,0x0011,0x000e,000000,000000},
165: /*f*/ {000000,000000,0x0004,0x0004,0x0004,0x000e,0x0004,0x0014,0x0008},
166: /*g*/ {0x000e,0x0011,0x0016,0x0019,0x0011,0x0019,0x0016,000000,000000},
167: /*h*/ {000000,000000,0x0011,0x0011,0x0011,0x0013,0x000d,0x0001,0x0001},
168: /*i*/ {000000,000000,0x000e,0x0004,0x0004,0x0004,0x0006,000000,0x0004},
169: /*j*/ {0x0006,0x0009,0x0008,0x0008,0x0008,0x0008,0x000c,000000,0x0008},
170: /*k*/ {000000,000000,0x0009,0x0005,0x0003,0x0005,0x0009,0x0001,0x0001},
171: /*l*/ {000000,000000,0x000e,0x0004,0x0004,0x0004,0x0004,0x0004,0x0006},
172: /*m*/ {000000,000000,0x0015,0x0015,0x0015,0x0015,0x000b,000000,000000},
173: /*n*/ {000000,000000,0x0011,0x0011,0x0011,0x0013,0x000d,000000,000000},
174: /*o*/ {000000,000000,0x000e,0x0011,0x0011,0x0011,0x000e,000000,000000},
175: /*p*/ {0x0001,0x0001,0x000d,0x0013,0x0011,0x0013,0x000d,000000,000000},
176: /*q*/ {0x0010,0x0010,0x0016,0x0019,0x0011,0x0019,0x0016,000000,000000},
177: /*r*/ {000000,000000,0x0001,0x0001,0x0001,0x0013,0x000d,000000,000000},
178: /*s*/ {000000,000000,0x000f,0x0010,0x000e,0x0001,0x001e,000000,000000},
179: /*t*/ {000000,000000,0x0008,0x0014,0x0004,0x0004,0x001f,0x0004,0x0004},
180: /*u*/ {000000,000000,0x0016,0x0019,0x0011,0x0011,0x0011,000000,000000},
181: /*v*/ {000000,000000,0x0004,0x000a,0x0011,0x0011,0x0011,000000,000000},
182: /*w*/ {000000,000000,0x000a,0x0015,0x0015,0x0011,0x0011,000000,000000},
183: /*x*/ {000000,000000,0x0011,0x000a,0x0004,0x000a,0x0011,000000,000000},
184: /*y*/ {0x000e,0x0010,0x001e,0x0011,0x0011,0x0011,0x0011,000000,000000},
185: /*z*/ {000000,000000,0x001f,0x0002,0x0004,0x0008,0x001f,000000,000000},
186: /*{*/ {000000,000000,0x0008,0x0004,0x0004,0x0002,0x0004,0x0004,0x0008},
187: /*|*/ {000000,000000,0x0004,0x0004,0x0004,000000,0x0004,0x0004,0x0004},
188: /*}*/ {000000,000000,0x0002,0x0004,0x0004,0x0008,0x0004,0x0004,0x0002},
189: /*~*/ {000000,000000,000000,000000,000000,000000,0x0008,0x0015,0x0002},
190: /*DEL*/{000000,000000,0x001f,0x001f,0x001f,0x001f,0x001f,0x001f,0x001f},
191: };
192:
193: /* 9x17 font, bottom row first, left pixel in lsb */
194: char_row GPFAR fnt9x17[FNT_CHARS][FNT9X17_VBITS] = {
195: /* */ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
196: 000000,000000,000000,000000,000000,000000,000000,000000},
197: /*!*/ {000000,000000,000000,000000,0x0010,000000,000000,000000,0x0010,
198: 0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010},
199: /*"*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
200: 000000,000000,000000,0x0044,0x0044,0x0044,0x0044,0x0044},
201: /*#*/ {000000,000000,000000,000000,0x0044,0x0044,0x0044,0x0044,0x01ff,
202: 0x0044,0x0044,0x0044,0x01ff,0x0044,0x0044,0x0044,0x0044},
203: /*$*/ {000000,000000,000000,000000,0x0010,0x0010,0x007e,0x0091,0x0110,
204: 0x0090,0x007c,0x0012,0x0011,0x0112,0x00fc,0x0010,0x0010},
205: /*%*/ {000000,000000,000000,000000,0x0080,0x0141,0x0081,0x0002,0x0004,
206: 0x0008,0x0010,0x0020,0x0040,0x0080,0x0102,0x0105,0x0002},
207: /*&*/ {000000,000000,000000,000000,0x011c,0x00a2,0x0041,0x00c1,0x0141,
208: 0x0022,0x001c,0x0014,0x0022,0x0022,0x001c,000000,000000},
209: /*'*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
210: 000000,000000,0x0004,0x0008,0x0010,0x0030,0x0038,0x0010},
211: /*(*/ {000000,000000,000000,000000,0x0040,0x0020,0x0010,0x0008,0x0008,
212: 0x0004,0x0004,0x0004,0x0008,0x0008,0x0010,0x0020,0x0040},
213: /*)*/ {000000,000000,000000,000000,0x0004,0x0008,0x0010,0x0020,0x0020,
214: 0x0040,0x0040,0x0040,0x0020,0x0020,0x0010,0x0008,0x0004},
215: /***/ {000000,000000,000000,000000,0x0010,0x0010,0x0111,0x0092,0x0054,
216: 0x0038,0x01ff,0x0038,0x0054,0x0092,0x0111,0x0010,0x0010},
217: /*+*/ {000000,000000,000000,000000,000000,000000,0x0010,0x0010,0x0010,
218: 0x0010,0x01ff,0x0010,0x0010,0x0010,0x0010,000000,000000},
219: /*,*/ {000000,000000,0x0004,0x0008,0x0010,0x0030,0x0038,0x0010,000000,
220: 000000,000000,000000,000000,000000,000000,000000,000000},
221: /*-*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
222: 000000,0x01ff,000000,000000,000000,000000,000000,000000},
223: /*.*/ {000000,000000,000000,000000,0x0010,0x0038,0x0010,000000,000000,
224: 000000,000000,000000,000000,000000,000000,000000,000000},
225: /*-/-*/{000000,000000,000000,000000,000000,000000,0x0001,0x0002,0x0004,
226: 0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,000000,000000},
227: /*0*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0103,0x0105,
228: 0x0109,0x0111,0x0121,0x0141,0x0181,0x0101,0x0082,0x007c},
229: /*1*/ {000000,000000,000000,000000,0x007c,0x0010,0x0010,0x0010,0x0010,
230: 0x0010,0x0010,0x0010,0x0010,0x0010,0x001c,0x0018,0x0010},
231: /*2*/ {000000,000000,000000,000000,0x01ff,0x0001,0x0001,0x0001,0x0001,
232: 0x0002,0x007c,0x0080,0x0100,0x0100,0x0101,0x0082,0x007c},
233: /*3*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0100,0x0100,
234: 0x0080,0x0078,0x0080,0x0100,0x0100,0x0101,0x0082,0x007c},
235: /*4*/ {000000,000000,000000,000000,0x0040,0x0040,0x0040,0x0040,0x0040,
236: 0x01ff,0x0041,0x0042,0x0044,0x0048,0x0050,0x0060,0x0040},
237: /*5*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0100,0x0100,
238: 0x0100,0x0080,0x007f,0x0001,0x0001,0x0001,0x0001,0x01ff},
239: /*6*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0101,0x0101,
240: 0x0081,0x007f,0x0001,0x0001,0x0001,0x0002,0x0084,0x0078},
241: /*7*/ {000000,000000,000000,000000,0x0001,0x0001,0x0001,0x0002,0x0004,
242: 0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,0x0100,0x01ff},
243: /*8*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0101,0x0101,
244: 0x0082,0x007c,0x0082,0x0101,0x0101,0x0101,0x0082,0x007c},
245: /*9*/ {000000,000000,000000,000000,0x001c,0x0022,0x0040,0x0080,0x0100,
246: 0x0100,0x01fc,0x0102,0x0101,0x0101,0x0101,0x0082,0x007c},
247: /*:*/ {000000,000000,000000,000000,000000,000000,0x0010,0x0038,0x0010,
248: 000000,000000,000000,0x0010,0x0038,0x0010,000000,000000},
249: /*;*/ {000000,000000,000000,0x0004,0x0008,0x0010,0x0030,0x0038,0x0010,
250: 000000,000000,000000,0x0010,0x0038,0x0010,000000,000000},
251: /*<*/ {000000,000000,000000,000000,0x0040,0x0020,0x0010,0x0008,0x0004,
252: 0x0002,0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040},
253: /*=*/ {000000,000000,000000,000000,000000,000000,000000,000000,0x01ff,
254: 000000,000000,000000,0x01ff,000000,000000,000000,000000},
255: /*>*/ {000000,000000,000000,000000,0x0004,0x0008,0x0010,0x0020,0x0040,
256: 0x0080,0x0100,0x0080,0x0040,0x0020,0x0010,0x0008,0x0004},
257: /*?*/ {000000,000000,000000,0x0010,0x0038,0x0010,000000,0x0010,0x0010,
258: 0x0020,0x0040,0x0080,0x0100,0x0100,0x0101,0x0082,0x007c},
259: /*@*/ {000000,000000,000000,000000,0x007c,0x0002,0x0001,0x01f9,0x0145,
260: 0x0145,0x0145,0x0179,0x0101,0x0101,0x0101,0x0082,0x007c},
261: /*A*/ {000000,000000,000000,000000,0x0101,0x0101,0x0101,0x0101,0x01ff,
262: 0x0101,0x0082,0x0082,0x0044,0x0044,0x0028,0x0028,0x0010},
263: /*B*/ {000000,000000,000000,000000,0x007f,0x0084,0x0104,0x0104,0x0104,
264: 0x0084,0x007c,0x0084,0x0104,0x0104,0x0104,0x0084,0x007f},
265: /*C*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0001,0x0001,
266: 0x0001,0x0001,0x0001,0x0001,0x0001,0x0101,0x0082,0x007c},
267: /*D*/ {000000,000000,000000,000000,0x007f,0x0084,0x0104,0x0104,0x0104,
268: 0x0104,0x0104,0x0104,0x0104,0x0104,0x0104,0x0084,0x007f},
269: /*E*/ {000000,000000,000000,000000,0x01ff,0x0001,0x0001,0x0001,0x0001,
270: 0x0001,0x001f,0x0001,0x0001,0x0001,0x0001,0x0001,0x01ff},
271: /*F*/ {000000,000000,000000,000000,0x0001,0x0001,0x0001,0x0001,0x0001,
272: 0x0001,0x001f,0x0001,0x0001,0x0001,0x0001,0x0001,0x01ff},
273: /*G*/ {000000,000000,000000,000000,0x00fc,0x0102,0x0101,0x0101,0x0101,
274: 0x0101,0x01c1,0x0001,0x0001,0x0001,0x0001,0x0102,0x00fc},
275: /*H*/ {000000,000000,000000,000000,0x0101,0x0101,0x0101,0x0101,0x0101,
276: 0x0101,0x01ff,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101},
277: /*I*/ {000000,000000,000000,000000,0x007c,0x0010,0x0010,0x0010,0x0010,
278: 0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x007c},
279: /*J*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0100,0x0100,
280: 0x0100,0x0100,0x0100,0x0100,0x0100,0x0100,0x0100,0x0180},
281: /*K*/ {000000,000000,000000,000000,0x0101,0x0081,0x0041,0x0021,0x0011,
282: 0x0009,0x0005,0x000b,0x0011,0x0021,0x0041,0x0081,0x0101},
283: /*L*/ {000000,000000,000000,000000,0x01ff,0x0101,0x0001,0x0001,0x0001,
284: 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001},
285: /*M*/ {000000,000000,000000,000000,0x0101,0x0101,0x0101,0x0101,0x0101,
286: 0x0101,0x0111,0x0111,0x0129,0x0145,0x0145,0x0183,0x0101},
287: /*N*/ {000000,000000,000000,000000,0x0101,0x0101,0x0101,0x0181,0x0141,
288: 0x0141,0x0121,0x0111,0x0109,0x0105,0x0105,0x0103,0x0101},
289: /*O*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0101,0x0101,
290: 0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0082,0x007c},
291: /*P*/ {000000,000000,000000,000000,0x0001,0x0001,0x0001,0x0001,0x0001,
292: 0x0001,0x007f,0x0081,0x0101,0x0101,0x0101,0x0081,0x007f},
293: /*Q*/ {000000,000000,0x0180,0x0040,0x007c,0x0092,0x0101,0x0101,0x0101,
294: 0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0082,0x007c},
295: /*R*/ {000000,000000,000000,000000,0x0101,0x0081,0x0041,0x0021,0x0011,
296: 0x0009,0x007f,0x0081,0x0101,0x0101,0x0101,0x0081,0x007f},
297: /*S*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0100,0x0100,
298: 0x0080,0x007c,0x0002,0x0001,0x0001,0x0101,0x0082,0x007c},
299: /*T*/ {000000,000000,000000,000000,0x0038,0x0010,0x0010,0x0010,0x0010,
300: 0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0111,0x01ff},
301: /*U*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0101,0x0101,
302: 0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101},
303: /*V*/ {000000,000000,000000,000000,0x0010,0x0010,0x0028,0x0028,0x0044,
304: 0x0044,0x0082,0x0082,0x0101,0x0101,0x0101,0x0101,0x0101},
305: /*W*/ {000000,000000,000000,000000,0x0101,0x0183,0x0145,0x0145,0x0129,
306: 0x0111,0x0111,0x0101,0x0101,0x0101,0x0101,0x0101,0x0101},
307: /*X*/ {000000,000000,000000,000000,0x0101,0x0101,0x0082,0x0082,0x0044,
308: 0x0028,0x0010,0x0028,0x0044,0x0082,0x0082,0x0101,0x0101},
309: /*Y*/ {000000,000000,000000,000000,0x0010,0x0010,0x0010,0x0010,0x0010,
310: 0x0010,0x0010,0x0028,0x0044,0x0082,0x0082,0x0101,0x0101},
311: /*Z*/ {000000,000000,000000,000000,0x01ff,0x0001,0x0002,0x0002,0x0004,
312: 0x0008,0x0010,0x0020,0x0040,0x0080,0x0080,0x0100,0x01ff},
313: /*[*/ {000000,000000,000000,000000,0x007c,0x0004,0x0004,0x0004,0x0004,
314: 0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004,0x007c},
315: /*\*/ {000000,000000,000000,000000,000000,000000,0x0100,0x0080,0x0040,
316: 0x0020,0x0010,0x0008,0x0004,0x0002,0x0001,000000,000000},
317: /*]*/ {000000,000000,000000,000000,0x007c,0x0040,0x0040,0x0040,0x0040,
318: 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x007c},
319: /*^*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
320: 000000,000000,000000,0x0101,0x0082,0x0044,0x0028,0x0010},
321: /*_*/ {000000,000000,000000,000000,0x01ff,000000,000000,000000,000000,
322: 000000,000000,000000,000000,000000,000000,000000,000000},
323: /*`*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
324: 000000,000000,0x0020,0x0010,0x0008,0x000c,0x001c,0x0008},
325: /*a*/ {000000,000000,000000,000000,0x03fc,0x0102,0x0101,0x0102,0x01fc,
326: 0x0100,0x0100,0x0080,0x007c,000000,000000,000000,000000},
327: /*b*/ {000000,000000,000000,000000,0x007d,0x0083,0x0101,0x0101,0x0101,
328: 0x0101,0x0101,0x0083,0x007d,0x0001,0x0001,0x0001,0x0001},
329: /*c*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0001,0x0001,
330: 0x0001,0x0101,0x0082,0x007c,000000,000000,000000,000000},
331: /*d*/ {000000,000000,000000,000000,0x017c,0x0182,0x0101,0x0101,0x0101,
332: 0x0101,0x0101,0x0182,0x017c,0x0100,0x0100,0x0100,0x0100},
333: /*e*/ {000000,000000,000000,000000,0x007c,0x0002,0x0001,0x0001,0x01ff,
334: 0x0101,0x0101,0x0082,0x007c,000000,000000,000000,000000},
335: /*f*/ {000000,000000,000000,000000,0x0010,0x0010,0x0010,0x0010,0x0010,
336: 0x0010,0x007c,0x0010,0x0010,0x0010,0x0110,0x00a0,0x0040},
337: /*g*/ {0x007c,0x0082,0x0101,0x0100,0x017c,0x0182,0x0101,0x0101,0x0101,
338: 0x0101,0x0101,0x0182,0x017c,000000,000000,000000,000000},
339: /*h*/ {000000,000000,000000,000000,0x0101,0x0101,0x0101,0x0101,0x0101,
340: 0x0103,0x0103,0x0085,0x0079,0x0001,0x0001,0x0001,0x0001},
341: /*i*/ {000000,000000,000000,000000,0x007c,0x0010,0x0010,0x0010,0x0010,
342: 0x0010,0x0010,0x0018,000000,000000,0x0018,0x0018,000000},
343: /*j*/ {0x003c,0x0042,0x0081,0x0080,0x0080,0x0080,0x0080,0x0080,0x0080,
344: 0x0080,0x0080,0x00c0,000000,000000,0x00c0,0x00c0,000000},
345: /*k*/ {000000,000000,000000,000000,0x0082,0x0042,0x0022,0x0012,0x000a,
346: 0x0016,0x0022,0x0042,0x0002,0x0002,0x0002,0x0002,0x0002},
347: /*l*/ {000000,000000,000000,000000,0x007c,0x0010,0x0010,0x0010,0x0010,
348: 0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x001c},
349: /*m*/ {000000,000000,000000,000000,0x0111,0x0111,0x0111,0x0111,0x0111,
350: 0x0111,0x0111,0x00ab,0x0045,000000,000000,000000,000000},
351: /*n*/ {000000,000000,000000,000000,0x0101,0x0101,0x0101,0x0101,0x0101,
352: 0x0101,0x0101,0x0083,0x007d,000000,000000,000000,000000},
353: /*o*/ {000000,000000,000000,000000,0x007c,0x0082,0x0101,0x0101,0x0101,
354: 0x0101,0x0101,0x0082,0x007c,000000,000000,000000,000000},
355: /*p*/ {0x0001,0x0001,0x0001,0x0001,0x007d,0x0003,0x0081,0x0101,0x0101,
356: 0x0101,0x0101,0x0083,0x007d,000000,000000,000000,000000},
357: /*q*/ {0x0100,0x0100,0x0100,0x0100,0x017c,0x0182,0x0101,0x0101,0x0101,
358: 0x0101,0x0101,0x0182,0x017c,000000,000000,000000,000000},
359: /*r*/ {000000,000000,000000,000000,0x0001,0x0001,0x0001,0x0001,0x0001,
360: 0x0001,0x0103,0x0085,0x0079,000000,000000,000000,000000},
361: /*s*/ {000000,000000,000000,000000,0x007e,0x0081,0x0100,0x0080,0x007c,
362: 0x0002,0x0001,0x0102,0x00fc,000000,000000,000000,000000},
363: /*t*/ {000000,000000,000000,000000,0x0040,0x00a0,0x0110,0x0010,0x0010,
364: 0x0010,0x0010,0x0010,0x00fe,0x0010,0x0010,0x0010,0x0010},
365: /*u*/ {000000,000000,000000,000000,0x013c,0x0142,0x0181,0x0101,0x0101,
366: 0x0101,0x0101,0x0101,0x0101,000000,000000,000000,000000},
367: /*v*/ {000000,000000,000000,000000,0x0010,0x0028,0x0044,0x0082,0x0101,
368: 0x0101,0x0101,0x0101,0x0101,000000,000000,000000,000000},
369: /*w*/ {000000,000000,000000,000000,0x0044,0x00aa,0x0111,0x0111,0x0101,
370: 0x0101,0x0101,0x0101,0x0101,000000,000000,000000,000000},
371: /*x*/ {000000,000000,000000,000000,0x0101,0x0082,0x0044,0x0028,0x0010,
372: 0x0028,0x0044,0x0082,0x0101,000000,000000,000000,000000},
373: /*y*/ {0x007c,0x0082,0x0101,0x0100,0x0100,0x01fc,0x0102,0x0101,0x0101,
374: 0x0101,0x0101,0x0101,0x0101,000000,000000,000000,000000},
375: /*z*/ {000000,000000,000000,000000,0x01ff,0x0002,0x0004,0x0008,0x0010,
376: 0x0020,0x0040,0x0080,0x01ff,000000,000000,000000,000000},
377: /*{*/ {000000,000000,000000,000000,0x00c0,0x0020,0x0010,0x0010,0x0010,
378: 0x0008,0x0004,0x0008,0x0010,0x0010,0x0010,0x0020,0x00c0},
379: /*|*/ {000000,000000,000000,000000,0x0010,0x0010,0x0010,0x0010,0x0010,
380: 000000,000000,000000,0x0010,0x0010,0x0010,0x0010,0x0010},
381: /*}*/ {000000,000000,000000,000000,0x0006,0x0008,0x0010,0x0010,0x0010,
382: 0x0020,0x0040,0x0020,0x0010,0x0010,0x0010,0x0008,0x0006},
383: /*~*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
384: 000000,000000,000000,0x0040,0x00a0,0x0111,0x000a,0x0004},
385: /*DEL*/{000000,000000,000000,000000,0x0155,000000,0x0155,000000,0x0155,
386: 000000,0x0155,000000,0x0155,000000,0x0155,000000,0x0155},
387: };
388:
389: /* 13x25 font, bottom row first, left pixel in lsb */
390: char_row GPFAR fnt13x25[FNT_CHARS][FNT13X25_VBITS] = {
391: /* */ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
392: 000000,000000,000000,000000,000000,000000,000000,000000,000000,
393: 000000,000000,000000,000000,000000,000000,000000},
394: /*!*/ {000000,000000,000000,000000,000000,0x00e0,0x00e0,0x00e0,000000,
395: 000000,000000,0x0040,0x0040,0x0040,0x0040,0x0040,0x00e0,0x00e0,
396: 0x00e0,0x00e0,0x00e0,0x00e0,0x00e0,0x00e0,0x0040},
397: /*"*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
398: 000000,000000,000000,000000,000000,000000,000000,000000,000000,
399: 0x0208,0x0208,0x0208,0x0208,0x0208,0x0208,0x0208},
400: /*#*/ {000000,000000,000000,000000,000000,000000,0x0208,0x0208,0x0208,
401: 0x0208,0x0208,0x0208,0x1fff,0x0208,0x0208,0x0208,0x0208,0x0208,
402: 0x1fff,0x0208,0x0208,0x0208,0x0208,0x0208,0x0208},
403: /*$*/ {000000,000000,000000,000000,000000,000000,0x0040,0x0040,0x0040,
404: 0x03f8,0x0444,0x0842,0x0840,0x0840,0x0440,0x03f8,0x0044,0x0042,
405: 0x0042,0x0842,0x0444,0x03f8,0x0040,0x0040,0x0040},
406: /*%*/ {000000,000000,000000,000000,000000,000000,0x0c00,0x1200,0x1201,
407: 0x0c01,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,
408: 0x0200,0x0400,0x0800,0x1006,0x1009,0x0009,0x0006},
409: /*&*/ {000000,000000,000000,000000,000000,000000,0x1078,0x1084,0x0902,
410: 0x0601,0x0601,0x0901,0x1081,0x0042,0x0024,0x0018,0x0018,0x0024,
411: 0x0042,0x0042,0x0042,0x0042,0x0024,0x0018,000000},
412: /*'*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
413: 000000,000000,000000,000000,000000,0x0001,0x0002,0x0004,0x0008,
414: 0x0010,0x0030,0x0078,0x0078,0x0078,0x0030,000000},
415: /*(*/ {000000,000000,000000,000000,000000,000000,0x0080,0x0040,0x0020,
416: 0x0020,0x0010,0x0008,0x0008,0x0004,0x0004,0x0004,0x0004,0x0004,
417: 0x0008,0x0008,0x0010,0x0020,0x0020,0x0040,0x0080},
418: /*)*/ {000000,000000,000000,000000,000000,000000,0x0020,0x0040,0x0080,
419: 0x0080,0x0100,0x0200,0x0200,0x0400,0x0400,0x0400,0x0400,0x0400,
420: 0x0200,0x0200,0x0100,0x0080,0x0080,0x0040,0x0020},
421: /***/ {000000,000000,000000,000000,000000,000000,0x0040,0x0040,0x0040,
422: 0x1041,0x0842,0x0444,0x0248,0x0150,0x00e0,0x1fff,0x00e0,0x0150,
423: 0x0248,0x0444,0x0842,0x1041,0x0040,0x0040,0x0040},
424: /*+*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
425: 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x1fff,0x0040,0x0040,
426: 0x0040,0x0040,0x0040,0x0040,000000,000000,000000},
427: /*,*/ {000000,000000,0x0001,0x0002,0x0004,0x0008,0x0010,0x0030,0x0078,
428: 0x0078,0x0078,0x0030,000000,000000,000000,000000,000000,000000,
429: 000000,000000,000000,000000,000000,000000,000000},
430: /*-*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
431: 000000,000000,000000,000000,000000,000000,0x1fff,000000,000000,
432: 000000,000000,000000,000000,000000,000000,000000},
433: /*.*/ {000000,000000,000000,000000,000000,000000,000000,0x0038,0x007c,
434: 0x007c,0x007c,0x0038,000000,000000,000000,000000,000000,000000,
435: 000000,000000,000000,000000,000000,000000,000000},
436: /*-/-*/{000000,000000,000000,000000,000000,000000,000000,000000,0x0001,
437: 0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,
438: 0x0200,0x0400,0x0800,0x1000,0x1000,000000,000000},
439: /*0*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
440: 0x1001,0x1003,0x1005,0x1009,0x1011,0x1021,0x1041,0x1081,0x1101,
441: 0x1201,0x1401,0x1801,0x1001,0x0802,0x0404,0x03f8},
442: /*1*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0040,0x0040,
443: 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,
444: 0x0040,0x0040,0x0040,0x0048,0x0070,0x0060,0x0040},
445: /*2*/ {000000,000000,000000,000000,000000,000000,0x1fff,0x0001,0x0001,
446: 0x0001,0x0001,0x0001,0x0001,0x0002,0x03fc,0x0400,0x0800,0x1000,
447: 0x1000,0x1000,0x1000,0x1001,0x0802,0x0404,0x03f8},
448: /*3*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
449: 0x1001,0x1000,0x1000,0x1000,0x0800,0x0400,0x03e0,0x0400,0x0800,
450: 0x1000,0x1000,0x1000,0x1001,0x0802,0x0404,0x03f8},
451: /*4*/ {000000,000000,000000,000000,000000,000000,0x0200,0x0200,0x0200,
452: 0x0200,0x0200,0x0200,0x0200,0x1fff,0x0201,0x0201,0x0202,0x0204,
453: 0x0208,0x0210,0x0220,0x0240,0x0280,0x0300,0x0200},
454: /*5*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
455: 0x1001,0x1000,0x1000,0x1000,0x1000,0x1000,0x0800,0x0400,0x03ff,
456: 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x1fff},
457: /*6*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
458: 0x1001,0x1001,0x1001,0x1001,0x0801,0x0401,0x03ff,0x0001,0x0001,
459: 0x0001,0x0001,0x0002,0x0004,0x0808,0x0410,0x03e0},
460: /*7*/ {000000,000000,000000,000000,000000,000000,0x0001,0x0001,0x0001,
461: 0x0002,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,
462: 0x0200,0x0400,0x0800,0x0800,0x1000,0x1000,0x1fff},
463: /*8*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
464: 0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,0x03f8,0x0404,0x0802,
465: 0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,0x03f8},
466: /*9*/ {000000,000000,000000,000000,000000,000000,0x00f8,0x0104,0x0202,
467: 0x0400,0x0800,0x1000,0x1000,0x1000,0x1000,0x1ff8,0x1004,0x1002,
468: 0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,0x03f8},
469: /*:*/ {000000,000000,000000,000000,000000,000000,000000,000000,0x0030,
470: 0x0078,0x0078,0x0030,000000,000000,000000,000000,000000,000000,
471: 0x0030,0x0078,0x0078,0x0030,000000,000000,000000},
472: /*;*/ {000000,000000,0x0001,0x0002,0x0004,0x0008,0x0010,0x0030,0x0078,
473: 0x0078,0x0078,0x0030,000000,000000,000000,000000,000000,000000,
474: 0x0030,0x0078,0x0078,0x0030,000000,000000,000000},
475: /*<*/ {000000,000000,000000,000000,000000,000000,0x0200,0x0100,0x0080,
476: 0x0040,0x0020,0x0010,0x0008,0x0004,0x0002,0x0001,0x0002,0x0004,
477: 0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,0x0200},
478: /*=*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
479: 000000,000000,000000,0x1fff,000000,000000,000000,000000,000000,
480: 0x1fff,000000,000000,000000,000000,000000,000000},
481: /*>*/ {000000,000000,000000,000000,000000,000000,0x0008,0x0010,0x0020,
482: 0x0040,0x0080,0x0100,0x0200,0x0400,0x0800,0x1000,0x0800,0x0400,
483: 0x0200,0x0100,0x0080,0x0040,0x0020,0x0010,0x0008},
484: /*?*/ {000000,000000,000000,000000,000000,0x0040,0x00e0,0x0040,000000,
485: 000000,000000,0x0040,0x0040,0x0080,0x0100,0x0200,0x0400,0x0800,
486: 0x1000,0x1000,0x1001,0x1001,0x0802,0x0404,0x03f8},
487: /*@*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0002,
488: 0x0001,0x0001,0x0ee1,0x1111,0x1111,0x1111,0x1111,0x1111,0x12e1,
489: 0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,0x03f8},
490: /*A*/ {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
491: 0x1001,0x1001,0x1001,0x1fff,0x1001,0x1001,0x1001,0x1001,0x0802,
492: 0x0802,0x0404,0x0208,0x0110,0x00a0,0x00a0,0x0040},
493: /*B*/ {000000,000000,000000,000000,000000,000000,0x03ff,0x0408,0x0808,
494: 0x1008,0x1008,0x1008,0x1008,0x0808,0x0408,0x03f8,0x0408,0x0808,
495: 0x1008,0x1008,0x1008,0x1008,0x0808,0x0408,0x03ff},
496: /*C*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
497: 0x1001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,
498: 0x0001,0x0001,0x0001,0x1001,0x0802,0x0404,0x03f8},
499: /*D*/ {000000,000000,000000,000000,000000,000000,0x03ff,0x0408,0x0808,
500: 0x1008,0x1008,0x1008,0x1008,0x1008,0x1008,0x1008,0x1008,0x1008,
501: 0x1008,0x1008,0x1008,0x1008,0x0808,0x0408,0x03ff},
502: /*E*/ {000000,000000,000000,000000,000000,000000,0x1fff,0x0001,0x0001,
503: 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x007f,0x0001,0x0001,
504: 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x1fff},
505: /*F*/ {000000,000000,000000,000000,000000,000000,0x0001,0x0001,0x0001,
506: 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x007f,0x0001,0x0001,
507: 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x1fff},
508: /*G*/ {000000,000000,000000,000000,000000,000000,0x0ff8,0x1004,0x1002,
509: 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1f01,0x0001,0x0001,
510: 0x0001,0x0001,0x0001,0x0001,0x0002,0x1004,0x0ff8},
511: /*H*/ {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
512: 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1fff,0x1001,0x1001,
513: 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001},
514: /*I*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0040,0x0040,
515: 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,
516: 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x03f8},
517: /*J*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
518: 0x1001,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,
519: 0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x1e00},
520: /*K*/ {000000,000000,000000,000000,000000,000000,0x1001,0x0801,0x0401,
521: 0x0201,0x0101,0x0081,0x0041,0x0021,0x0011,0x000f,0x0009,0x0011,
522: 0x0021,0x0041,0x0081,0x0101,0x0201,0x0401,0x0801},
523: /*L*/ {000000,000000,000000,000000,000000,000000,0x1fff,0x1001,0x1001,
524: 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,
525: 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001},
526: /*M*/ {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
527: 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1041,0x1041,0x10a1,
528: 0x10a1,0x1111,0x1209,0x1209,0x1405,0x1803,0x1001},
529: /*N*/ {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
530: 0x1001,0x1801,0x1401,0x1201,0x1201,0x1101,0x1081,0x1041,0x1041,
531: 0x1021,0x1011,0x1009,0x1009,0x1005,0x1003,0x1001},
532: /*O*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
533: 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,
534: 0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,0x03f8},
535: /*P*/ {000000,000000,000000,000000,000000,000000,0x0001,0x0001,0x0001,
536: 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x03ff,0x0401,0x0801,
537: 0x1001,0x1001,0x1001,0x1001,0x0801,0x0401,0x03ff},
538: /*Q*/ {000000,000000,000000,000000,0x0c00,0x0200,0x03f8,0x0494,0x0862,
539: 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,
540: 0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,0x03f8},
541: /*R*/ {000000,000000,000000,000000,000000,000000,0x1001,0x0801,0x0401,
542: 0x0201,0x0101,0x0081,0x0041,0x0021,0x0011,0x03ff,0x0401,0x0801,
543: 0x1001,0x1001,0x1001,0x1001,0x0801,0x0401,0x03ff},
544: /*S*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
545: 0x1001,0x1000,0x1000,0x1000,0x0800,0x0400,0x03f8,0x0004,0x0002,
546: 0x0001,0x0001,0x0001,0x1001,0x0802,0x0404,0x03f8},
547: /*T*/ {000000,000000,000000,000000,000000,000000,0x00e0,0x0040,0x0040,
548: 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,
549: 0x0040,0x0040,0x0040,0x0040,0x0040,0x1041,0x1fff},
550: /*U*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
551: 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,
552: 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001},
553: /*V*/ {000000,000000,000000,000000,000000,000000,0x0040,0x0040,0x00a0,
554: 0x00a0,0x0110,0x0110,0x0208,0x0208,0x0404,0x0404,0x0802,0x0802,
555: 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001},
556: /*W*/ {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1803,
557: 0x1405,0x1405,0x1209,0x1209,0x1111,0x1111,0x10a1,0x1041,0x1001,
558: 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001},
559: /*X*/ {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
560: 0x0802,0x0802,0x0404,0x0208,0x0110,0x00a0,0x0040,0x00a0,0x0110,
561: 0x0208,0x0404,0x0802,0x0802,0x1001,0x1001,0x1001},
562: /*Y*/ {000000,000000,000000,000000,000000,000000,0x0040,0x0040,0x0040,
563: 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x00a0,0x0110,0x0208,
564: 0x0404,0x0802,0x0802,0x1001,0x1001,0x1001,0x1001},
565: /*Z*/ {000000,000000,000000,000000,000000,000000,0x1fff,0x0001,0x0001,
566: 0x0002,0x0004,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,
567: 0x0200,0x0400,0x0400,0x0800,0x1000,0x1000,0x1fff},
568: /*[*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0008,0x0008,
569: 0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,
570: 0x0008,0x0008,0x0008,0x0008,0x0008,0x0008,0x03f8},
571: /*\*/ {000000,000000,000000,000000,000000,000000,000000,000000,0x1000,
572: 0x1000,0x0800,0x0400,0x0200,0x0100,0x0080,0x0040,0x0020,0x0010,
573: 0x0008,0x0004,0x0002,0x0001,0x0001,000000,000000},
574: /*]*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0200,0x0200,
575: 0x0200,0x0200,0x0200,0x0200,0x0200,0x0200,0x0200,0x0200,0x0200,
576: 0x0200,0x0200,0x0200,0x0200,0x0200,0x0200,0x03f8},
577: /*^*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
578: 000000,000000,000000,000000,000000,000000,000000,000000,000000,
579: 0x1001,0x0802,0x0404,0x0208,0x0110,0x00a0,0x0040},
580: /*_*/ {000000,000000,000000,000000,000000,000000,0x1fff,000000,000000,
581: 000000,000000,000000,000000,000000,000000,000000,000000,000000,
582: 000000,000000,000000,000000,000000,000000,000000},
583: /*`*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
584: 000000,000000,000000,000000,000000,0x0400,0x0200,0x0100,0x0080,
585: 0x0040,0x0060,0x00f0,0x00f0,0x00f0,0x0060,000000},
586: /*a*/ {000000,000000,000000,000000,000000,000000,0x17f8,0x0804,0x0802,
587: 0x0802,0x0802,0x0804,0x0ff8,0x0800,0x0800,0x0800,0x0800,0x0404,
588: 0x03f8,000000,000000,000000,000000,000000,000000},
589: /*b*/ {000000,000000,000000,000000,000000,000000,0x03f9,0x0405,0x0803,
590: 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x0803,0x0405,
591: 0x03f9,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001},
592: /*c*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
593: 0x1001,0x0001,0x0001,0x0001,0x0001,0x0001,0x1001,0x0802,0x0404,
594: 0x03f8,000000,000000,000000,000000,000000,000000},
595: /*d*/ {000000,000000,000000,000000,000000,000000,0x13f8,0x1404,0x1802,
596: 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1802,0x1404,
597: 0x13f8,0x1000,0x1000,0x1000,0x1000,0x1000,0x1000},
598: /*e*/ {000000,000000,000000,000000,000000,000000,0x0ff8,0x0004,0x0002,
599: 0x0001,0x0001,0x0001,0x1fff,0x1001,0x1001,0x1001,0x0802,0x0404,
600: 0x03f8,000000,000000,000000,000000,000000,000000},
601: /*f*/ {000000,000000,000000,000000,000000,000000,0x0040,0x0040,0x0040,
602: 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x03f8,0x0040,0x0040,
603: 0x0040,0x0040,0x0040,0x1040,0x0880,0x0500,0x0200},
604: /*g*/ {0x03f8,0x0404,0x0802,0x1001,0x1000,0x1000,0x13f8,0x1404,0x1802,
605: 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1802,0x1404,
606: 0x13f8,000000,000000,000000,000000,000000,000000},
607: /*h*/ {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
608: 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x0803,0x0405,
609: 0x03f9,0x0001,0x0001,0x0001,0x0001,0x0001,0x0001},
610: /*i*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0040,0x0040,
611: 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0070,
612: 000000,000000,000000,0x00e0,0x00e0,0x00e0,000000},
613: /*j*/ {0x00f0,0x0108,0x0204,0x0402,0x0400,0x0400,0x0400,0x0400,0x0400,
614: 0x0400,0x0400,0x0400,0x0400,0x0400,0x0400,0x0400,0x0400,0x0700,
615: 000000,000000,000000,0x0700,0x0700,0x0700,000000},
616: /*k*/ {000000,000000,000000,000000,000000,000000,0x0804,0x0404,0x0204,
617: 0x0104,0x0084,0x0044,0x0024,0x0014,0x002c,0x0044,0x0084,0x0104,
618: 0x0204,0x0004,0x0004,0x0004,0x0004,0x0004,0x0004},
619: /*l*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0040,0x0040,
620: 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,
621: 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0070},
622: /*m*/ {000000,000000,000000,000000,000000,000000,0x1041,0x1041,0x1041,
623: 0x1041,0x1041,0x1041,0x1041,0x1041,0x1041,0x1041,0x08a3,0x0515,
624: 0x0209,000000,000000,000000,000000,000000,000000},
625: /*n*/ {000000,000000,000000,000000,000000,000000,0x1001,0x1001,0x1001,
626: 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x0803,0x0405,
627: 0x03f9,000000,000000,000000,000000,000000,000000},
628: /*o*/ {000000,000000,000000,000000,000000,000000,0x03f8,0x0404,0x0802,
629: 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x0802,0x0404,
630: 0x03f8,000000,000000,000000,000000,000000,000000},
631: /*p*/ {0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x03f9,0x0405,0x0803,
632: 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x0803,0x0405,
633: 0x03f9,000000,000000,000000,000000,000000,000000},
634: /*q*/ {0x1000,0x1000,0x1000,0x1000,0x1000,0x1000,0x13f8,0x1404,0x1802,
635: 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1802,0x1404,
636: 0x13f8,000000,000000,000000,000000,000000,000000},
637: /*r*/ {000000,000000,000000,000000,000000,000000,0x0001,0x0001,0x0001,
638: 0x0001,0x0001,0x0001,0x0001,0x0001,0x0001,0x1001,0x0803,0x0405,
639: 0x03f9,000000,000000,000000,000000,000000,000000},
640: /*s*/ {000000,000000,000000,000000,000000,000000,0x03fc,0x0402,0x0800,
641: 0x0800,0x0800,0x0400,0x03f8,0x0004,0x0002,0x0002,0x0002,0x0804,
642: 0x07f8,000000,000000,000000,000000,000000,000000},
643: /*t*/ {000000,000000,000000,000000,000000,000000,0x0200,0x0500,0x0880,
644: 0x1040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,
645: 0x07fc,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040},
646: /*u*/ {000000,000000,000000,000000,000000,000000,0x13f8,0x1404,0x1802,
647: 0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,
648: 0x1001,000000,000000,000000,000000,000000,000000},
649: /*v*/ {000000,000000,000000,000000,000000,000000,0x0040,0x00a0,0x0110,
650: 0x0208,0x0404,0x0802,0x0802,0x1001,0x1001,0x1001,0x1001,0x1001,
651: 0x1001,000000,000000,000000,000000,000000,000000},
652: /*w*/ {000000,000000,000000,000000,000000,000000,0x0208,0x0514,0x08a2,
653: 0x08a2,0x1041,0x1041,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,
654: 0x1001,000000,000000,000000,000000,000000,000000},
655: /*x*/ {000000,000000,000000,000000,000000,000000,0x1001,0x0802,0x0404,
656: 0x0208,0x0110,0x00a0,0x0040,0x00a0,0x0110,0x0208,0x0404,0x0802,
657: 0x1001,000000,000000,000000,000000,000000,000000},
658: /*y*/ {0x03f8,0x0404,0x0802,0x1001,0x1000,0x1000,0x1000,0x1000,0x1ff8,
659: 0x1004,0x1002,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,0x1001,
660: 0x1001,000000,000000,000000,000000,000000,000000},
661: /*z*/ {000000,000000,000000,000000,000000,000000,0x1fff,0x0002,0x0004,
662: 0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,0x0200,0x0400,0x0800,
663: 0x1fff,000000,000000,000000,000000,000000,000000},
664: /*{*/ {000000,000000,000000,000000,000000,000000,0x0600,0x0100,0x0080,
665: 0x0040,0x0040,0x0040,0x0040,0x0040,0x0020,0x0010,0x0020,0x0040,
666: 0x0040,0x0040,0x0040,0x0040,0x0080,0x0100,0x0600},
667: /*|*/ {000000,000000,000000,000000,000000,000000,0x0040,0x0040,0x0040,
668: 0x0040,0x0040,0x0040,0x0040,000000,000000,000000,000000,000000,
669: 0x0040,0x0040,0x0040,0x0040,0x0040,0x0040,0x0040},
670: /*}*/ {000000,000000,000000,000000,000000,000000,0x000c,0x0010,0x0020,
671: 0x0040,0x0040,0x0040,0x0040,0x0040,0x0080,0x0100,0x0080,0x0040,
672: 0x0040,0x0040,0x0040,0x0040,0x0020,0x0010,0x000c},
673: /*~*/ {000000,000000,000000,000000,000000,000000,000000,000000,000000,
674: 000000,000000,000000,000000,000000,000000,000000,000000,000000,
675: 0x0600,0x0900,0x1080,0x1041,0x0021,0x0012,0x000c},
676: /*DEL*/{000000,000000,000000,000000,000000,000000,0x1249,000000,000000,
677: 0x1249,000000,000000,0x1249,000000,000000,0x1249,000000,000000,
678: 0x1249,000000,000000,0x1249,000000,000000,0x1249},
679: };
680:
1.1.1.2 maekawa 681: /* Moved here from gif.trm */
682: struct rgb web_color_rgbs[] =
683: {
684: { 0xff, 0xff, 0xff }, /* background: white */
685: { 0x00, 0x00, 0x00 }, /* borders: black */
686: { 0xa0, 0xa0, 0xa0 }, /* x & y axes: grey */
687: { 0xff, 0x00, 0x00 }, /* color 01: red */
688: { 0x00, 0xc0, 0x00 }, /* color 02: dark green */
689: { 0x00, 0x80, 0xff }, /* color 03: dark blue */
690: { 0xc0, 0x00, 0xff }, /* color 04: dark magenta */
691: { 0xc0, 0xff, 0x40 }, /* color 05: yellow */
692: { 0xc0, 0x40, 0x00 }, /* color 06: orange */
693: { 0x40, 0xff, 0x80 }, /* color 07: sea green */
694: { 0x20, 0x20, 0xc0 }, /* color 08: royal blue */
695: { 0x80, 0x00, 0xc0 }, /* color 09: dark violet */
696: /* please note: these colors are optimized for web216 compatibility */
697: { 0x00, 0x60, 0x80 }, /* DeepSkyBlue4 */
698: { 0x00, 0x80, 0x00 }, /* green4 */
699: { 0x00, 0x80, 0x40 }, /* SpringGreen4 */
700: { 0x00, 0x80, 0x80 }, /* dark cyan, turquoise4 */
701: { 0x00, 0xc0, 0x60 }, /* SpringGreen3 */
702: { 0x00, 0xc0, 0xc0 }, /* cyan3, turquoise3 */
703: { 0x00, 0xff, 0x00 }, /* green */
704: { 0x20, 0x80, 0x20 }, /* forest green */
705: { 0x30, 0x60, 0x80 }, /* SteelBlue4 */
706: { 0x40, 0x40, 0x40 }, /* grey25-31 */
707: { 0x40, 0x80, 0x00 }, /* chartreuse4 */
708: { 0x00, 0x00, 0x80 }, /* dark blue, navy blue */
709: { 0x80, 0x60, 0x00 }, /* DarkGoldenrod4 */
710: { 0x80, 0x60, 0x10 }, /* goldenrod4 */
711: { 0x80, 0x60, 0x60 }, /* pink4 */
712: { 0x80, 0x60, 0x80 }, /* plum4 */
713: { 0x00, 0x00, 0xc0 }, /* medium blue */
714: { 0x00, 0x00, 0xff }, /* blue */
715: { 0x00, 0x60, 0x00 }, /* dark green */
716: { 0x40, 0xc0, 0x80 }, /* SeaGreen3 */
717: { 0x60, 0xa0, 0xc0 }, /* SkyBlue3 */
718: { 0x60, 0xc0, 0x00 }, /* chartreuse3 */
719: { 0x60, 0xc0, 0xa0 }, /* medium aquamarine */
720: { 0x80, 0x00, 0x00 }, /* dark red */
721: { 0x80, 0x00, 0x80 }, /* dark magenta */
722: { 0x60, 0x20, 0x80 }, /* DarkOrchid4 */
723: { 0x60, 0x60, 0x60 }, /* dim grey */
724: { 0x00, 0xff, 0xff }, /* cyan1, turquoise1 */
725: { 0x20, 0x20, 0x20 }, /* grey13-18 */
726: { 0x20, 0x40, 0x40 }, /* dark slate grey */
727: { 0x20, 0x40, 0x80 }, /* RoyalBlue4 */
728: { 0x60, 0x80, 0x20 }, /* olive drab */
729: { 0x60, 0x80, 0x60 }, /* DarkSeaGreen4 */
730: { 0x60, 0x80, 0x80 }, /* LightBlue4, PaleTurquoise4 */
731: { 0x80, 0x80, 0x40 }, /* LightGoldenrod4, khaki4 */
732: { 0x80, 0x80, 0x80 }, /* grey51-56 */
733: { 0xa0, 0xa0, 0xa0 }, /* dark grey, grey63-68 */
734: { 0xa0, 0xd0, 0xe0 }, /* light blue */
735: { 0xc0, 0x20, 0x20 }, /* firebrick3 */
736: { 0xc0, 0x60, 0x00 }, /* DarkOrange3 */
737: { 0x80, 0xc0, 0xe0 }, /* sky blue */
738: { 0xc0, 0x60, 0xc0 }, /* orchid3 */
739: { 0xc0, 0x80, 0x00 }, /* orange3 */
740: { 0xc0, 0x80, 0x60 }, /* LightSalmon3 */
741: { 0xff, 0x40, 0x00 }, /* orange red */
742: { 0xff, 0x40, 0x40 }, /* brown1, tomato */
743: { 0x80, 0xc0, 0xff }, /* light sky blue */
744: { 0xff, 0x80, 0x60 }, /* salmon */
745: { 0xff, 0x80, 0x80 }, /* light coral */
746: { 0xc0, 0xa0, 0x00 }, /* gold3 */
747: { 0xc0, 0xc0, 0xc0 }, /* grey76-81, honeydew3, ivory3, snow3 */
748: { 0xc0, 0xff, 0xc0 }, /* DarkSeaGreen1 */
749: { 0xff, 0x00, 0x00 }, /* red */
750: { 0xff, 0x00, 0xff }, /* magenta */
751: { 0xff, 0x80, 0xa0 }, /* PaleVioletRed1 */
752: { 0xff, 0x80, 0xff }, /* orchid1 */
753: { 0xc0, 0xc0, 0xa0 }, /* LemonChiffon3 */
754: { 0xff, 0x60, 0x60 }, /* IndianRed1 */
755: { 0xff, 0x80, 0x00 }, /* dark orange */
756: { 0xff, 0xa0, 0x00 }, /* orange */
757: { 0x80, 0xe0, 0xe0 }, /* CadetBlue2, DarkSlateGray2 */
758: { 0xa0, 0xe0, 0xe0 }, /* pale turquoise */
759: { 0xa0, 0xff, 0x20 }, /* green yellow */
760: { 0xc0, 0x00, 0x00 }, /* red3 */
761: { 0xc0, 0x00, 0xc0 }, /* magenta3 */
762: { 0xa0, 0x20, 0x20 }, /* brown */
763: { 0xa0, 0x20, 0xff }, /* purple */
764: { 0x80, 0x20, 0x00 }, /* OrangeRed4 */
765: { 0x80, 0x20, 0x20 }, /* brown4 */
766: { 0x80, 0x40, 0x00 }, /* DarkOrange4 */
767: { 0x80, 0x40, 0x20 }, /* sienna4 */
768: { 0x80, 0x40, 0x80 }, /* orchid4 */
769: { 0x80, 0x60, 0xc0 }, /* MediumPurple3 */
770: { 0x80, 0x60, 0xff }, /* SlateBlue1 */
771: { 0x80, 0x80, 0x00 }, /* yellow4 */
772: { 0xa0, 0x80, 0xff }, /* MediumPurple1 */
773: { 0xc0, 0x60, 0x80 }, /* PaleVioletRed3 */
774: { 0xc0, 0xc0, 0x00 }, /* yellow3 */
775: { 0xff, 0x80, 0x40 }, /* sienna1 */
776: { 0xff, 0xa0, 0x40 }, /* tan1 */
777: { 0xff, 0xa0, 0x60 }, /* sandy brown */
778: { 0xff, 0xa0, 0x70 }, /* light salmon */
779: { 0xff, 0xc0, 0x20 }, /* goldenrod1 */
780: { 0xff, 0xc0, 0xc0 }, /* RosyBrown1, pink */
781: { 0xff, 0xff, 0x00 }, /* yellow */
782: { 0xff, 0xff, 0x80 }, /* khaki1 */
783: { 0xff, 0xff, 0xc0 } /* lemon chiffon */
784: };
1.1 maekawa 785:
786: /*
787: ** The plotting area is defined as a huge bitmap.
788: ** The bitmap is stored in a dynamically allocated pixel array b_p
789: **
790: ** The bitmap is allocated (and initialized to zero) with
791: ** b_makebitmap(xsize, ysize, planes)
792: ** and freed with b_freebitmap()
793: ** xsize and ysize will be rounded up to a multiple of 8.
794: **
795: ** Valid (int) coordinates range from zero to (xsize-1,ysize-1)
796: **
797: ** Plotting is done via b_move(x, y) and b_vector(x, y) functions,
798: ** where the point (x,y) is the target to go from the current point
799: ** To set the color use b_setvalue(value) where value is the value
800: ** (0 or 1 or a color number) to be stored in every pixel.
801: ** To get dotted line styles, use b_setlinetype(linetype).
802: **
803: ** Internally all plotting goes through b_setpixel(x, y, value).
804: */
805:
806:
807: /*
808: * set pixel (x, y, value) to value value (this can be 1/0 or a color number).
809: */
810: void b_setpixel(x, y, value)
811: unsigned int x, y, value;
812: {
813: register unsigned int row;
814: register unsigned char mask;
815: unsigned int i;
816:
817: if (b_rastermode) {
818: /* interchange so that new (x,y) is old (y,b_ysize-1-x) */
819: row = x; /* temp storage */
820: x = y;
821: y = b_ysize - 1 - row;
822: }
823: if (IN(x, b_xsize) && IN(y, b_ysize)) {
824: row = y / 8;
825: mask = 1 << (y % 8);
826:
827: for (i = 0; i < b_planes; i++) {
828: if (value & 1)
829: *((*b_p)[row] + x) |= mask;
830: else
831: *((*b_p)[row] + x) &= ~mask;
832: row += b_psize;
833: value >>= 1;
834: }
835: }
836: #ifdef BITMAPDEBUG
837: else {
838: if (b_rastermode)
839: fprintf(stderr, "Warning: setpixel(%d, %d, %d) out of bounds\n",
840: b_ysize - 1 - y, x, value);
841: else
842: fprintf(stderr, "Warning: setpixel(%d, %d, %d) out of bounds\n",
843: x, y, value);
844: }
845: #endif
846: }
847:
848:
849: /*
850: * get pixel (x,y) value
851: */
852: unsigned int
853: b_getpixel(x, y)
854: unsigned int x, y;
855: {
856: register unsigned int row;
857: register unsigned char mask;
1.1.1.3 ! ohara 858: register unsigned char value = 0;
1.1 maekawa 859: int i;
860:
861: if (b_rastermode) {
862: row = x;
863: x = y;
864: y = b_ysize-1-row;
865: }
866: if (IN(x, b_xsize) && IN(y, b_ysize))
867: {
868: row = y/8 + (b_planes-1)*b_psize;
869: mask = 1<<(y%8);
870:
871: for (i=0; i<b_planes; i++) {
872: if ( *((*b_p)[row]+x) & mask )
873: value |= 1;
874: row -= b_psize;
875: value <<= 1;
876: }
1.1.1.3 ! ohara 877: /* HBB 991123: the missing '>>1' was the 'every second color' problem
! 878: * with PNG in 3.8a...*/
! 879: return(value>>1);
! 880: } else {
1.1 maekawa 881: #ifdef BITMAPDEBUG
882: if (b_rastermode)
883: fprintf(stderr, "Warning: getpixel(%d,%d) out of bounds\n",
884: b_ysize-1-y, x);
885: else
886: fprintf(stderr, "Warning: getpixel(%d,%d) out of bounds\n", x, y);
887: #endif
888: return(0);
889: }
890: }
891:
892:
893: /*
894: * allocate the bitmap
895: */
896: void b_makebitmap(x, y, planes)
897: unsigned int x, y, planes;
898: {
899: register unsigned j;
900: unsigned rows;
901:
902: x = 8 * (unsigned int) (x / 8.0 + 0.9); /* round up to multiple of 8 */
903: y = 8 * (unsigned int) (y / 8.0 + 0.9); /* round up to multiple of 8 */
904: b_psize = y / 8; /* size of each plane */
905: rows = b_psize * planes; /* total number of rows of 8 pixels high */
906: b_xsize = x;
907: b_ysize = y;
908: b_currx = b_curry = 0;
909: b_planes = planes;
910: b_value = 1;
911: b_angle = 0;
912: b_rastermode = 0;
913: /* allocate row pointers */
1.1.1.3 ! ohara 914: b_p = (bitmap *) gp_alloc(rows * sizeof(pixels *), "bitmap row buffer");
1.1 maekawa 915: memset(b_p, 0, rows * sizeof(pixels *));
916: for (j = 0; j < rows; j++) {
917: /* allocate bitmap buffers */
1.1.1.3 ! ohara 918: (*b_p)[j] = (pixels *) gp_alloc(x * sizeof(pixels), (char *) NULL);
1.1 maekawa 919: if ((*b_p)[j] == (pixels *) NULL) {
920: b_freebitmap(); /* free what we have already allocated */
921: int_error("out of memory for bitmap buffer", NO_CARET);
922: }
923: memset((*b_p)[j], 0, x * sizeof(pixels));
924: }
925: }
926:
927:
928: /*
929: * free the allocated bitmap
930: */
931: void b_freebitmap()
932: {
933: unsigned int j, rows;
934:
935: rows = b_psize * b_planes; /* total number of rows of 8 pixels high */
936: for (j = 0; j < rows; j++) {
937: (void) free((char *) (*b_p)[j]);
938: }
939: (void) free((char *) b_p);
940: b_p = (bitmap *) (NULL);
941: }
942:
943:
944: /*
945: * set pixel at (x,y) with color b_value and dotted mask b_linemask.
946: */
947: void b_setmaskpixel(x, y, value)
948: unsigned int x, y, value;
949: {
950: /* dotted line generator */
951: if ((b_linemask >> b_maskcount) & (unsigned int) (1)) {
952: b_setpixel(x, y, value);
953: }
954: b_maskcount = (b_maskcount + 1) % 16;
955: b_lastx = x; /* last pixel set with mask */
956: b_lasty = y;
957: }
958:
959:
960: /*
961: * draw a line from (x1,y1) to (x2,y2)
962: * with color b_value and dotted mask b_linemask.
963: */
964: void b_line(x1, y1, x2, y2)
965: unsigned int x1, y1, x2, y2;
966: {
967: int runcount;
968: int dx, dy;
969: int xinc, yinc;
970: unsigned int xplot, yplot;
971:
972: runcount = 0;
973: dx = abs((int) (x1) - (int) (x2));
974: if (x2 > x1)
975: xinc = 1;
976: else if (x2 == x1)
977: xinc = 0;
978: else
979: xinc = -1;
980: dy = abs((int) (y1) - (int) (y2));
981: if (y2 > y1)
982: yinc = 1;
983: else if (y2 == y1)
984: yinc = 0;
985: else
986: yinc = -1;
987: xplot = x1;
988: yplot = y1;
989: if (dx > dy) {
990: /* iterate x */
991: if ((b_linemask == 0xffff) ||
992: ((xplot != b_lastx) && (yplot != b_lasty)))
993: b_setmaskpixel(xplot, yplot, b_value);
994: while (xplot != x2) {
995: xplot += xinc;
996: runcount += dy;
997: if (runcount >= (dx - runcount)) {
998: yplot += yinc;
999: runcount -= dx;
1000: }
1001: b_setmaskpixel(xplot, yplot, b_value);
1002: }
1003: } else {
1004: /* iterate y */
1005: if ((b_linemask == 0xffff) ||
1006: ((xplot != b_lastx) && (yplot != b_lasty)))
1007: b_setmaskpixel(xplot, yplot, b_value);
1008: while (yplot != y2) {
1009: yplot += yinc;
1010: runcount += dx;
1011: if (runcount >= (dy - runcount)) {
1012: xplot += xinc;
1013: runcount -= dy;
1014: }
1015: b_setmaskpixel(xplot, yplot, b_value);
1016: }
1017: }
1018: }
1019:
1020:
1021: /*
1022: * set character size
1023: */
1024: void b_charsize(size)
1025: unsigned int size;
1026: {
1027: int j;
1028: switch (size) {
1029: case FNT5X9:
1030: b_hchar = FNT5X9_HCHAR;
1031: b_hbits = FNT5X9_HBITS;
1032: b_vchar = FNT5X9_VCHAR;
1033: b_vbits = FNT5X9_VBITS;
1034: for (j = 0; j < FNT_CHARS; j++)
1035: b_font[j] = &fnt5x9[j][0];
1036: break;
1037: case FNT9X17:
1038: b_hchar = FNT9X17_HCHAR;
1039: b_hbits = FNT9X17_HBITS;
1040: b_vchar = FNT9X17_VCHAR;
1041: b_vbits = FNT9X17_VBITS;
1042: for (j = 0; j < FNT_CHARS; j++)
1043: b_font[j] = &fnt9x17[j][0];
1044: break;
1045: case FNT13X25:
1046: b_hchar = FNT13X25_HCHAR;
1047: b_hbits = FNT13X25_HBITS;
1048: b_vchar = FNT13X25_VCHAR;
1049: b_vbits = FNT13X25_VBITS;
1050: for (j = 0; j < FNT_CHARS; j++)
1051: b_font[j] = &fnt13x25[j][0];
1052: break;
1053: default:
1054: int_error("Unknown character size", NO_CARET);
1055: }
1056: }
1057:
1058:
1059: /*
1060: * put characater c at (x,y) rotated by angle with color b_value.
1061: */
1062: static void b_putc(x, y, c, c_angle)
1063: unsigned int x, y;
1064: int c;
1065: unsigned int c_angle;
1066: {
1067: unsigned int i, j, k;
1068: char_row fc;
1069:
1070: j = c - ' ';
1071:
1072: if (j >= FNT_CHARS)
1073: return; /* unknown (top-bit-set ?) character */
1074:
1075: for (i = 0; i < b_vbits; i++) {
1076: fc = *(b_font[j] + i);
1077: if (c == '_') { /* treat underline specially */
1078: if (fc) { /* this this the underline row ? */
1079: /* draw the under line for the full h_char width */
1080: for (k = (b_hbits - b_hchar) / 2;
1081: k < (b_hbits + b_hchar) / 2; k++) {
1082: switch (c_angle) {
1083: case 0:
1084: b_setpixel(x + k + 1, y + i, b_value);
1085: break;
1086: case 1:
1087: b_setpixel(x - i, y + k + 1, b_value);
1088: break;
1089: }
1090: }
1091: }
1092: } else {
1093: /* draw character */
1094: for (k = 0; k < b_hbits; k++) {
1095: if ((fc >> k) & 1) {
1096: switch (c_angle) {
1097: case 0:
1098: b_setpixel(x + k + 1, y + i, b_value);
1099: break;
1100: case 1:
1101: b_setpixel(x - i, y + k + 1, b_value);
1102: break;
1103: }
1104: }
1105: }
1106: }
1107: }
1108: }
1109:
1110:
1111: /*
1112: ** set b_linemask to b_pattern[linetype]
1113: */
1114: void b_setlinetype(linetype)
1115: int linetype;
1116: {
1117: if (linetype >= 7)
1118: linetype %= 7;
1119: b_linemask = b_pattern[linetype + 2];
1120: b_maskcount = 0;
1121: }
1122:
1123:
1124: /*
1125: * set b_value to value
1126: */
1127: void b_setvalue(value)
1128: unsigned int value;
1129: {
1130: b_value = value;
1131: }
1132:
1133:
1134: /*
1135: * move to (x,y)
1136: */
1137: void b_move(x, y)
1138: unsigned int x, y;
1139: {
1140: b_currx = x;
1141: b_curry = y;
1142: }
1143:
1144:
1145: /*
1146: * draw to (x,y) with color b_value
1147: */
1148: void b_vector(x, y)
1149: unsigned int x, y;
1150: {
1151: b_line(b_currx, b_curry, x, y);
1152: b_currx = x;
1153: b_curry = y;
1154: }
1155:
1156:
1157: /*
1158: * put text str at (x,y) with color b_value and rotation b_angle
1159: */
1160: void b_put_text(x, y, str)
1161: unsigned int x, y;
1162: char *str;
1163: {
1164: if (b_angle == 1)
1165: x += b_vchar / 2;
1166: else
1167: y -= b_vchar / 2;
1168: switch (b_angle) {
1169: case 0:
1170: for (; *str; ++str, x += b_hchar)
1171: b_putc(x, y, *str, b_angle);
1172: break;
1173: case 1:
1174: for (; *str; ++str, y += b_hchar)
1175: b_putc(x, y, *str, b_angle);
1176: break;
1177: }
1178: }
1179:
1180:
1181: int b_text_angle(ang)
1182: int ang;
1183: {
1184: b_angle = (unsigned int) ang;
1185: return TRUE;
1186: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>