home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume16 / gnuplot2.02 / patch3 / patch2b
Encoding:
Text File  |  1991-01-05  |  55.4 KB  |  1,134 lines

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