home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / DWNSRS56.ZIP / DOWNFNT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-10-20  |  24.8 KB  |  484 lines

  1. /* ============================================================= */
  2. /*  Rob Hamerling's MAXIMUS DOWNload file SORT and list utility. */
  3. /*  -> DOWNFNT.C                                                 */
  4. /*  -> Block font definitions and generation routine.            */
  5. /* ============================================================= */
  6.  
  7. #define INCL_BASE
  8. #include <os2.h>
  9.  
  10. #include <ctype.h>
  11. #include <stdio.h>
  12. #include <string.h>
  13.  
  14. #include "downsort.h"
  15. #include "downfpro.h"
  16.  
  17. struct _b8_patt {                       // 8 column font
  18.         unsigned c0:3, c1:3, c2:3, c3:3, c4:3, c5:3, c6:3, c7:3; };
  19. struct _b8x5 {                          // all fonts defined as 8x5
  20.          char           c;              // the character
  21.          unsigned char  k;              // number of active columns
  22.          struct _b8_patt p[5];          // 8 column x 5 lines pattern
  23.            };
  24.  
  25. /* ===================================================== */
  26. /* Generate string of block-characters (1 part per call) */
  27. /* ===================================================== */
  28. char *strnblk(char  *b,
  29.               short int n,
  30.               short int f,
  31.               short int k)
  32. {
  33.   int  i, j, x ,w;                      // counters
  34.  
  35.   static struct _b8x5 f1[] = {          // simple 5x3 font
  36.     {'A',6, 1,2,2,2,1,0,0,0, 3,1,1,1,3,0,0,0, 3,0,0,0,3,0,0,0,
  37.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  38.     {'B',6, 3,2,2,2,1,0,0,0, 3,2,2,2,1,0,0,0, 3,1,1,1,2,0,0,0,
  39.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  40.     {'C',6, 1,2,2,2,1,0,0,0, 3,0,0,0,0,0,0,0, 2,1,1,1,2,0,0,0,
  41.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  42.     {'D',6, 3,2,2,2,1,0,0,0, 3,0,0,0,3,0,0,0, 3,1,1,1,2,0,0,0,
  43.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  44.     {'E',6, 3,2,2,2,2,0,0,0, 3,2,2,0,0,0,0,0, 3,1,1,1,1,0,0,0,
  45.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  46.     {'F',6, 3,2,2,2,2,0,0,0, 3,1,1,0,0,0,0,0, 3,0,0,0,0,0,0,0,
  47.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  48.     {'G',6, 1,2,2,2,1,0,0,0, 3,0,0,1,1,0,0,0, 2,1,1,1,2,0,0,0,
  49.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  50.     {'H',6, 3,0,0,0,3,0,0,0, 3,1,1,1,3,0,0,0, 3,0,0,0,3,0,0,0,
  51.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  52.     {'I',4, 2,3,2,0,0,0,0,0, 0,3,0,0,0,0,0,0, 1,3,1,0,0,0,0,0,
  53.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  54.     {'J',6, 0,2,2,2,3,0,0,0, 0,0,0,0,3,0,0,0, 2,1,1,1,2,0,0,0,
  55.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  56.     {'K',6, 3,0,0,1,2,0,0,0, 3,2,2,1,0,0,0,0, 3,0,0,0,3,0,0,0,
  57.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  58.     {'L',6, 3,0,0,0,0,0,0,0, 3,0,0,0,0,0,0,0, 3,1,1,1,1,0,0,0,
  59.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  60.     {'M',6, 3,1,0,1,3,0,0,0, 3,2,3,2,3,0,0,0, 3,0,0,0,3,0,0,0,
  61.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  62.     {'N',6, 3,1,0,0,3,0,0,0, 3,2,3,1,3,0,0,0, 3,0,0,2,3,0,0,0,
  63.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  64.     {'O',6, 1,2,2,2,1,0,0,0, 3,0,0,0,3,0,0,0, 2,1,1,1,2,0,0,0,
  65.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  66.     {'P',6, 3,2,2,2,1,0,0,0, 3,1,1,1,2,0,0,0, 3,0,0,0,0,0,0,0,
  67.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  68.     {'Q',6, 1,2,2,2,1,0,0,0, 3,0,1,0,3,0,0,0, 2,1,1,2,1,0,0,0,
  69.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  70.     {'R',6, 3,2,2,2,1,0,0,0, 3,1,1,1,2,0,0,0, 3,0,2,1,1,0,0,0,
  71.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  72.     {'S',6, 1,2,2,2,2,0,0,0, 0,2,2,2,1,0,0,0, 1,1,1,1,2,0,0,0,
  73.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  74.     {'T',6, 2,2,3,2,2,0,0,0, 0,0,3,0,0,0,0,0, 0,0,3,0,0,0,0,0,
  75.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  76.     {'U',6, 3,0,0,0,3,0,0,0, 3,0,0,0,3,0,0,0, 2,1,1,1,2,0,0,0,
  77.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  78.     {'V',6, 3,0,0,0,3,0,0,0, 3,1,0,1,3,0,0,0, 0,2,3,2,0,0,0,0,
  79.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  80.     {'W',6, 3,0,0,0,3,0,0,0, 3,0,1,0,3,0,0,0, 2,3,2,3,2,0,0,0,
  81.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  82.     {'X',6, 2,1,0,1,2,0,0,0, 0,0,3,0,0,0,0,0, 1,2,0,2,1,0,0,0,
  83.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  84.     {'Y',6, 3,0,0,0,3,0,0,0, 2,3,1,3,2,0,0,0, 0,0,3,0,0,0,0,0,
  85.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  86.     {'Z',6, 2,2,2,2,3,0,0,0, 0,1,2,2,0,0,0,0, 3,1,1,1,1,0,0,0,
  87.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  88.     {'0',6, 1,2,2,3,1,0,0,0, 3,0,3,0,3,0,0,0, 2,3,1,1,2,0,0,0,
  89.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  90.     {'1',4, 1,3,0,0,0,0,0,0, 0,3,0,0,0,0,0,0, 1,3,1,0,0,0,
  91.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  92.     {'2',6, 1,2,2,2,1,0,0,0, 0,1,1,1,2,0,0,0, 3,1,1,1,1,0,0,0,
  93.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  94.     {'3',6, 1,2,2,2,1,0,0,0, 0,0,2,2,1,0,0,0, 2,1,1,1,2,0,0,0,
  95.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  96.     {'4',6, 0,0,1,2,3,0,0,0, 1,2,0,0,3,0,0,0, 2,2,2,2,3,0,0,0,
  97.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  98.     {'5',6, 3,2,2,2,2,0,0,0, 2,2,2,2,1,0,0,0, 2,1,1,1,2,0,0,0,
  99.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  100.     {'6',6, 1,2,2,2,0,0,0,0, 3,2,2,2,1,0,0,0, 2,1,1,1,2,0,0,0,
  101.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  102.     {'7',6, 2,2,2,2,3,0,0,0, 0,0,1,2,0,0,0,0, 0,3,0,0,0,0,0,0,
  103.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  104.     {'8',6, 1,2,2,2,1,0,0,0, 1,2,2,2,1,0,0,0, 2,1,1,1,2,0,0,0,
  105.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  106.     {'9',6, 1,2,2,2,1,0,0,0, 2,1,1,1,3,0,0,0, 0,1,1,1,2,0,0,0,
  107.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  108.     {'_',6, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 1,1,1,1,1,0,0,0,
  109.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  110.     {'*',6, 1,0,1,0,1,0,0,0, 1,3,2,3,1,0,0,0, 1,2,3,2,1,0,0,0,
  111.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  112.     {'-',4, 0,0,0,0,0,0,0,0, 1,1,1,0,0,0,0,0, 0,0,0,0,0,0,0,0,
  113.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  114.     {'|',3, 0,3,0,0,0,0,0,0, 0,3,0,0,0,0,0,0, 0,3,0,0,0,0,0,0,
  115.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  116.     {'.',2, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 1,0,0,0,0,0,0,0,
  117.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  118.     {'(',4, 0,1,2,0,0,0,0,0, 3,0,0,0,0,0,0,0, 0,2,1,0,0,0,0,0,
  119.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  120.     {')',4, 2,1,0,0,0,0,0,0, 0,0,3,0,0,0,0,0, 1,2,0,0,0,0,0,0,
  121.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  122.     {'[',4, 3,2,2,0,0,0,0,0, 3,0,0,0,0,0,0,0, 3,1,1,0,0,0,0,0,
  123.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  124.     {']',4, 2,2,3,0,0,0,0,0, 0,0,3,0,0,0,0,0, 1,1,3,0,0,0,0,0,
  125.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  126.     {'/',6, 0,0,0,0,1,0,0,0, 0,0,1,2,0,0,0,0, 1,2,0,0,0,0,0,0,
  127.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  128.    {'\\',6, 1,0,0,0,0,0,0,0, 0,2,1,0,0,0,0,0, 0,0,0,2,1,0,0,0,
  129.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  130.     {'`',3, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
  131.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  132.     {' ',4, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
  133.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  134.         };
  135.  
  136.   static struct _b8x5 f2[] = {          // 7x5 pseudo stencil
  137.     {'A',8, 0,3,3,3,3,3,0,0, 3,3,0,0,0,3,3,0, 3,3,6,3,3,3,3,0,
  138.             3,3,0,0,0,3,3,0, 3,3,0,0,0,3,3,0},
  139.     {'B',8, 3,3,6,3,3,3,0,0, 3,3,0,0,0,3,3,0, 3,3,6,3,3,3,0,0,
  140.             3,3,0,0,0,3,3,0, 3,3,6,3,3,3,0,0},
  141.     {'C',8, 0,3,6,3,3,3,0,0, 3,3,0,0,0,3,3,0, 3,3,0,0,0,0,0,0,
  142.             3,3,0,0,0,3,3,0, 0,3,6,3,3,3,0,0},
  143.     {'D',8, 3,3,6,3,3,3,0,0, 3,3,0,0,0,3,3,0, 3,3,0,0,0,3,3,0,
  144.             3,3,0,0,0,3,3,0, 3,3,6,3,3,3,0,0},
  145.     {'E',8, 3,3,6,3,3,3,3,0, 3,3,0,0,0,0,0,0, 3,3,6,3,3,0,0,0,
  146.             3,3,0,0,0,0,0,0, 3,3,6,3,3,3,3,0},
  147.     {'F',8, 3,3,6,3,3,3,3,0, 3,3,0,0,0,0,0,0, 3,3,6,3,3,0,0,0,
  148.             3,3,0,0,0,0,0,0, 3,3,0,0,0,0,0,0},
  149.     {'G',8, 0,3,6,3,3,3,0,0, 3,3,0,0,0,3,3,0, 3,3,0,0,0,0,0,0,
  150.             3,3,0,0,2,3,3,0, 3,3,6,3,3,3,0,0},
  151.     {'H',8, 3,3,0,0,0,3,3,0, 3,3,0,0,0,3,3,0, 3,3,6,3,3,3,3,0,
  152.             3,3,0,0,0,3,3,0, 3,3,0,0,0,3,3,0},
  153.     {'I',6, 3,6,3,3,3,0,0,0, 0,6,3,3,0,0,0,0, 0,6,3,3,0,0,0,0,
  154.             0,6,3,3,0,0,0,0, 3,6,3,3,3,0,0,0},
  155.     {'J',8, 0,0,0,0,0,3,3,0, 0,0,0,0,0,3,3,0, 0,0,0,0,0,3,3,0,
  156.             3,6,0,0,0,3,3,0, 0,6,3,3,3,3,2,0},
  157.     {'K',8, 3,3,0,0,0,3,3,0, 3,3,0,3,3,0,0,0, 3,3,6,3,0,0,0,0,
  158.             3,3,0,3,3,0,0,0, 3,3,0,0,0,3,3,0},
  159.     {'L',8, 3,3,0,0,0,0,0,0, 3,3,0,0,0,0,0,0, 3,3,0,0,0,0,0,0,
  160.             3,3,0,0,0,0,0,0, 3,3,6,3,3,3,3,0},
  161.     {'M',8, 3,3,6,3,3,3,3,0, 3,3,0,3,0,3,3,0, 3,3,0,3,0,3,3,0,
  162.             3,3,0,0,0,3,3,0, 3,3,0,0,0,3,3,0},
  163.     {'N',7, 3,3,6,3,3,3,0,0, 3,3,0,0,3,3,0,0, 3,3,0,0,3,3,0,0,
  164.             3,3,0,0,3,3,0,0, 3,3,0,0,3,3,0,0},
  165.     {'O',8, 0,3,6,3,3,3,0,0, 3,3,0,0,0,3,3,0, 3,3,0,0,0,3,3,0,
  166.             3,3,0,0,0,3,3,0, 0,3,6,3,3,3,0,0},
  167.     {'P',8, 3,3,6,3,3,3,0,0, 3,3,0,0,0,3,3,0, 3,3,6,3,3,3,0,0,
  168.             3,3,0,0,0,0,0,0, 3,3,0,0,0,0,0,0},
  169.     {'Q',8, 0,3,6,3,3,3,0,0, 3,3,0,0,0,3,3,0, 3,3,0,0,0,3,3,0,
  170.             3,3,0,0,3,3,0,0, 0,3,6,3,3,0,3,0},
  171.     {'R',8, 3,3,6,3,3,3,0,0, 3,3,0,0,0,3,3,0, 3,3,6,3,3,3,0,0,
  172.             3,3,0,3,0,0,0,0, 3,3,0,0,3,3,0,0},
  173.     {'S',8, 3,3,6,3,3,3,3,0, 3,3,0,0,0,0,0,0, 3,3,6,3,3,3,3,0,
  174.             0,0,0,0,0,3,3,0, 3,3,6,3,3,3,3,0},
  175.     {'T',8, 3,3,6,3,3,3,3,0, 0,0,6,3,3,0,0,0, 0,0,6,3,3,0,0,0,
  176.             0,0,6,3,3,0,0,0, 0,0,6,3,3,0,0,0},
  177.     {'U',8, 3,3,0,0,0,3,3,0, 3,3,0,0,0,3,3,0, 3,3,0,0,0,3,3,0,
  178.             3,3,0,0,0,3,3,0, 0,3,6,3,3,3,0,0},
  179.     {'V',8, 3,3,0,0,0,3,3,0, 3,3,0,0,0,3,3,0, 3,3,0,0,0,3,3,0,
  180.             0,3,6,0,3,3,0,0, 0,0,6,3,3,0,0,0},
  181.     {'W',8, 3,3,0,0,0,3,3,0, 3,3,0,0,0,3,3,0, 3,3,0,3,0,3,3,0,
  182.             3,3,0,3,0,3,3,0, 0,3,6,3,3,3,0,0},
  183.     {'X',8, 3,3,0,0,0,3,3,0, 0,3,6,0,3,3,0,0, 0,0,6,3,3,0,0,0,
  184.             0,3,6,0,3,3,0,0, 3,3,0,0,0,3,3,0},
  185.     {'Y',8, 3,3,0,0,0,3,3,0, 3,3,0,0,0,3,3,0, 0,3,6,3,3,3,0,0,
  186.             0,0,0,3,3,0,0,0, 0,0,0,3,3,0,0,0},
  187.     {'Z',8, 3,6,3,3,3,3,3,0, 0,0,0,0,3,3,0,0, 0,0,0,3,3,0,0,0,
  188.             0,0,3,3,0,0,0,0, 3,6,3,3,3,3,3,0},
  189.     {'0',8, 0,6,3,3,3,3,0,0, 3,6,0,0,0,3,3,0, 3,6,0,3,0,3,3,0,
  190.             3,6,0,0,0,3,3,0, 0,6,3,3,3,3,0,0},
  191.     {'1',5, 3,3,3,0,0,0,0,0, 0,3,3,0,0,0,0,0, 0,3,3,0,0,0,0,0,
  192.             0,3,3,0,0,0,0,0, 3,3,3,3,0,0,0,0},
  193.     {'2',8, 3,3,6,3,3,3,0,0, 0,0,0,0,3,3,3,0, 3,3,6,3,3,3,0,0,
  194.             3,3,0,0,0,0,0,0, 3,3,6,3,3,3,3,0},
  195.     {'3',8, 0,3,6,3,3,3,0,0, 3,3,0,0,0,3,3,0, 0,0,0,0,3,3,0,0,
  196.             3,3,6,0,0,3,3,0, 0,3,6,3,3,3,0,0},
  197.     {'4',8, 3,3,0,0,3,3,0,0, 3,3,0,0,3,3,0,0, 3,3,6,3,3,3,3,0,
  198.             0,0,0,0,3,3,0,0, 0,0,0,0,3,3,0,0},
  199.     {'5',8, 3,3,6,3,3,3,3,0, 3,3,0,0,0,0,0,0, 3,3,6,3,3,3,0,0,
  200.             0,0,0,0,0,3,3,0, 3,3,6,3,3,3,0,0},
  201.     {'6',8, 0,6,3,3,3,3,0,0, 3,6,0,0,0,0,0,0, 3,6,3,3,3,3,0,0,
  202.             3,6,0,0,0,3,3,0, 0,6,3,3,3,3,0,0},
  203.     {'7',8, 3,6,3,3,3,3,0,0, 0,0,0,0,0,3,3,0, 0,0,0,3,3,0,0,0,
  204.             0,0,3,3,0,0,0,0, 0,0,3,3,0,0,0,0},
  205.     {'8',8, 0,3,6,3,3,3,0,0, 3,3,0,0,0,3,3,0, 0,3,6,3,3,3,0,0,
  206.             3,3,0,0,0,3,3,0, 0,3,6,3,3,3,0,0},
  207.     {'9',8, 0,3,6,3,3,3,0,0, 3,3,0,0,0,3,3,0, 0,3,6,3,3,3,3,0,
  208.             0,0,0,0,0,3,3,0, 0,3,6,3,3,3,3,0},
  209.     {'_',7, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
  210.             0,0,0,0,0,0,0,0, 0,3,6,3,3,3,0,0},
  211.     {'*',8, 0,3,0,6,0,3,0,0, 0,0,3,6,3,0,0,0, 3,3,3,6,3,3,3,0,
  212.             0,0,3,6,3,0,0,0, 0,3,0,6,0,3,0,0},
  213.     {'-',5, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 3,6,3,3,0,0,0,0,
  214.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  215.     {'|',4, 0,3,3,0,0,0,0,0, 0,3,3,0,0,0,0,0, 0,3,3,0,0,0,0,0,
  216.             0,3,3,0,0,0,0,0, 0,3,3,0,0,0,0,0},
  217.     {'.',5, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
  218.             0,0,0,0,0,0,0,0, 0,3,6,3,0,0,0,0},
  219.     {'(',5, 0,0,6,3,0,0,0,0, 0,3,6,0,0,0,0,0, 3,3,0,0,0,0,0,0,
  220.             0,3,6,0,0,0,0,0, 0,0,6,3,0,0,0,0},
  221.     {')',5, 0,3,5,0,0,0,0,0, 0,0,5,3,0,0,0,0, 0,0,0,3,3,0,0,0,
  222.             0,0,5,3,0,0,0,0, 0,3,5,0,0,0,0,0},
  223.     {'[',5, 0,3,6,3,0,0,0,0, 0,3,6,0,0,0,0,0, 0,3,6,0,0,0,0,0,
  224.             0,3,6,0,0,0,0,0, 0,3,6,3,0,0,0,0},
  225.     {']',5, 0,3,5,3,0,0,0,0, 0,0,5,3,0,0,0,0, 0,0,5,3,0,0,0,0,
  226.             0,0,5,3,0,0,0,0, 0,3,5,3,0,0,0,0},
  227.     {'/',7, 0,0,0,0,3,3,0,0, 0,0,0,3,3,0,0,0, 0,0,6,3,0,0,0,0,
  228.             0,3,6,0,0,0,0,0, 3,3,0,0,0,0,0,0},
  229.    {'\\',7, 0,3,3,0,0,0,0,0, 0,0,3,6,0,0,0,0, 0,0,0,6,3,0,0,0,
  230.             0,0,0,0,3,3,0,0, 0,0,0,0,0,3,3,0},
  231.     {'`',4, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
  232.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  233.     {' ',5, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
  234.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  235.      };
  236.  
  237.   static struct _b8x5 f3[] = {          // 7x4 robo-computer font
  238.     {'A',8, 0,3,2,2,2,3,0,0, 1,3,1,1,1,3,1,0, 3,3,0,0,0,0,3,0,
  239.             3,3,0,0,0,0,3,0, 0,0,0,0,0,0,0,0},
  240.     {'B',8, 3,2,2,2,2,3,0,0, 3,1,1,1,1,1,3,0, 3,3,0,0,0,0,3,0,
  241.             3,3,1,1,1,1,3,0, 0,0,0,0,0,0,0,0},
  242.     {'C',8, 3,2,2,2,2,2,3,0, 3,1,0,0,0,0,0,0, 3,3,0,0,0,0,0,0,
  243.             3,3,1,1,1,1,3,0, 0,0,0,0,0,0,0,0},
  244.     {'D',8, 3,2,2,2,2,2,3,0, 3,1,0,0,0,0,3,0, 3,3,0,0,0,0,3,0,
  245.             3,3,1,1,1,1,3,0, 0,0,0,0,0,0,0,0},
  246.     {'E',8, 3,2,2,2,2,2,2,0, 3,1,1,1,1,1,1,0, 3,3,0,0,0,0,0,0,
  247.             3,3,1,1,1,1,1,0, 0,0,0,0,0,0,0,0},
  248.     {'F',8, 3,2,2,2,2,2,2,0, 3,1,1,1,1,1,1,0, 3,3,0,0,0,0,0,0,
  249.             3,3,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  250.     {'G',8, 3,2,2,2,2,2,3,0, 3,1,0,0,1,1,1,0, 3,3,0,0,0,0,3,0,
  251.             3,3,1,1,1,1,3,0, 0,0,0,0,0,0,0,0},
  252.     {'H',8, 3,0,0,0,0,0,3,0, 3,1,1,1,1,1,3,0, 3,3,0,0,0,0,3,0,
  253.             3,3,0,0,0,0,3,0, 0,0,0,0,0,0,0,0},
  254.     {'I',5, 0,3,0,0,0,0,0,0, 0,3,1,0,0,0,0,0, 0,3,3,0,0,0,0,0,
  255.             0,3,3,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  256.     {'J',8, 0,0,0,0,0,3,0,0, 0,0,0,0,0,3,1,0, 0,0,0,0,0,3,3,0,
  257.             3,1,1,1,1,3,3,0, 0,0,0,0,0,0,0,0},
  258.     {'K',8, 3,0,0,0,3,0,0,0, 3,1,1,3,1,1,1,0, 3,3,0,0,0,0,3,0,
  259.             3,3,0,0,0,0,3,0, 0,0,0,0,0,0,0,0},
  260.     {'L',8, 3,0,0,0,0,0,0,0, 3,1,0,0,0,0,0,0, 3,3,0,0,0,0,0,0,
  261.             3,3,1,1,1,1,1,0, 0,0,0,0,0,0,0,0},
  262.     {'M',8, 3,2,2,3,2,2,3,0, 3,1,0,3,0,0,3,0, 3,3,0,3,0,0,3,0,
  263.             3,3,0,3,0,0,3,0, 0,0,0,0,0,0,0,0},
  264.     {'N',8, 3,2,2,2,2,2,3,0, 3,1,0,0,0,0,3,0, 3,3,0,0,0,0,3,0,
  265.             3,3,0,0,0,0,3,0, 0,0,0,0,0,0,0,0},
  266.     {'O',8, 3,2,2,2,3,3,3,0, 3,0,0,0,0,2,3,0, 3,0,0,0,0,0,3,0,
  267.             3,1,1,1,1,1,3,0, 0,0,0,0,0,0,0,0},
  268.     {'P',8, 3,2,2,2,2,2,3,0, 3,1,1,1,1,1,3,0, 3,3,0,0,0,0,0,0,
  269.             3,3,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  270.     {'Q',8, 3,2,2,2,2,2,3,0, 3,0,0,0,0,0,3,0, 3,0,0,0,0,0,3,0,
  271.             3,1,1,3,3,3,3,0, 0,0,0,0,0,0,0,0},
  272.     {'R',8, 3,2,2,2,2,3,0,0, 3,1,1,1,1,3,1,0, 3,3,0,0,0,0,3,0,
  273.             3,3,0,0,0,0,3,0, 0,0,0,0,0,0,0,0},
  274.     {'S',8, 3,2,2,2,2,2,3,0, 3,1,1,1,1,1,1,0, 0,0,0,0,0,3,3,0,
  275.             3,1,1,1,1,3,3,0, 0,0,0,0,0,0,0,0},
  276.     {'T',8, 2,2,2,3,2,2,2,0, 0,0,0,3,1,0,0,0, 0,0,0,3,3,0,0,0,
  277.             0,0,0,3,3,0,0,0, 0,0,0,0,0,0,0,0},
  278.     {'U',8, 3,0,0,0,0,0,3,0, 3,1,0,0,0,0,3,0, 3,3,0,0,0,0,3,0,
  279.             3,3,1,1,1,1,3,0, 0,0,0,0,0,0,0,0},
  280.     {'V',8, 3,3,0,0,0,0,3,0, 3,3,0,0,0,1,3,0, 0,3,0,0,0,3,0,0,
  281.             0,3,1,1,1,3,0,0, 0,0,0,0,0,0,0,0},
  282.     {'W',8, 3,0,0,3,0,0,3,0, 3,1,0,3,0,0,3,0, 3,3,0,3,0,0,3,0,
  283.             3,3,1,3,1,1,3,0, 0,0,0,0,0,0,0,0},
  284.     {'X',8, 3,0,0,0,0,0,3,0, 2,1,1,1,1,1,2,0, 3,3,0,0,0,0,3,0,
  285.             3,3,0,0,0,0,3,0, 0,0,0,0,0,0,0,0},
  286.     {'Y',8, 3,0,0,0,0,0,3,0, 3,1,1,1,1,1,3,0, 0,0,0,3,3,0,0,0,
  287.             0,0,0,3,3,0,0,0, 0,0,0,0,0,0,0,0},
  288.     {'Z',8, 2,2,2,2,2,2,3,0, 1,1,1,1,1,1,3,0, 3,3,0,0,0,0,0,0,
  289.             3,3,1,1,1,1,1,0, 0,0,0,0,0,0,0,0},
  290.     {'0',8, 3,2,2,2,2,2,3,0, 3,0,0,0,0,1,3,0, 3,0,0,0,0,3,3,0,
  291.             3,1,1,1,1,3,3,0, 0,0,0,0,0,0,0,0},
  292.     {'1',5, 0,0,3,0,0,0,0,0, 0,1,3,0,0,0,0,0, 0,3,3,0,0,0,0,0,
  293.             0,3,3,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  294.     {'2',8, 3,2,2,2,2,2,3,0, 0,0,0,0,0,0,3,0, 3,3,2,2,2,2,2,0,
  295.             3,3,1,1,1,1,3,0, 0,0,0,0,0,0,0,0},
  296.     {'3',8, 3,2,2,2,2,3,0,0, 0,1,1,1,1,3,1,0, 0,0,0,0,0,3,3,0,
  297.             3,1,1,1,1,3,3,0, 0,0,0,0,0,0,0,0},
  298.     {'4',8, 3,0,0,0,0,3,0,0, 3,0,0,0,0,3,0,0, 3,1,1,1,1,3,1,0,
  299.             0,0,0,0,3,3,0,0, 0,0,0,0,0,0,0,0},
  300.     {'5',8, 3,2,2,2,2,2,2,0, 3,1,1,1,1,1,1,0, 0,0,0,0,0,3,3,0,
  301.             3,1,1,1,1,3,3,0, 0,0,0,0,0,0,0,0},
  302.     {'6',8, 3,2,2,2,2,2,3,0, 3,1,1,1,1,1,1,0, 3,0,0,0,0,3,3,0,
  303.             3,1,1,1,1,3,3,0, 0,0,0,0,0,0,0,0},
  304.     {'7',8, 2,2,2,2,2,2,3,0, 0,0,0,0,0,1,3,0, 0,0,0,0,0,3,3,0,
  305.             0,0,0,0,0,3,3,0, 0,0,0,0,0,0,0,0},
  306.     {'8',8, 0,3,2,2,2,3,0,0, 1,3,1,1,1,3,1,0, 3,0,0,0,0,3,3,0,
  307.             3,1,1,1,1,3,3,0, 0,0,0,0,0,0,0,0},
  308.     {'9',8, 3,2,2,2,2,2,3,0, 3,0,0,0,0,0,3,0, 2,2,2,2,2,3,3,0,
  309.             0,0,0,0,0,3,3,0, 0,0,0,0,0,0,0,0},
  310.     {'-',5, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 3,3,3,3,0,0,0,0,
  311.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  312.     {'`',4, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
  313.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  314.     {' ',5, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
  315.             0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0},
  316.       };
  317.  
  318.   static struct _b8x5 f4[] = {          // 7x4 reversed video FONT3
  319.     {'A',8, 3,2,2,2,2,2,3,3, 3,0,3,3,3,0,3,3, 0,0,1,1,1,1,0,3,
  320.             0,0,3,3,3,3,0,3, 1,1,3,3,3,3,1,3},
  321.     {'B',8, 2,2,2,2,2,2,3,3, 0,3,3,3,3,1,2,3, 0,0,1,1,1,1,0,3,
  322.             0,0,3,3,3,3,0,3, 1,1,1,1,1,1,1,3},
  323.     {'C',8, 2,2,2,2,2,2,2,3, 0,3,3,3,3,3,1,3, 0,0,3,3,3,3,3,3,
  324.             0,0,3,3,3,3,2,3, 1,1,1,1,1,1,1,3},
  325.     {'D',8, 2,2,2,2,2,2,2,3, 0,3,3,3,3,3,0,3, 0,0,3,3,3,3,0,3,
  326.             0,0,3,3,3,3,0,3, 1,1,1,1,1,1,1,3},
  327.     {'E',8, 2,2,2,2,2,2,2,3, 0,3,3,3,3,3,3,3, 0,0,1,1,1,1,1,3,
  328.             0,0,3,3,3,3,3,3, 1,1,1,1,1,1,1,3},
  329.     {'F',8, 2,2,2,2,2,2,2,3, 0,3,3,3,3,3,3,3, 0,0,1,1,1,1,1,3,
  330.             0,0,3,3,3,3,3,3, 1,1,3,3,3,3,3,3},
  331.     {'G',8, 2,2,2,2,2,2,2,3, 0,3,3,3,3,3,1,3, 0,0,3,3,1,1,0,3,
  332.             0,0,3,3,3,3,0,3, 1,1,1,1,1,1,1,3},
  333.     {'H',8, 2,3,3,3,3,3,2,3, 0,3,3,3,3,3,0,3, 0,0,1,1,1,1,0,3,
  334.             0,0,3,3,3,3,0,3, 1,1,3,3,3,3,1,3},
  335.     {'I',5, 3,2,3,3,3,3,3,3, 3,0,3,3,3,3,3,3, 3,0,0,3,3,3,3,3,
  336.             3,0,0,3,3,3,3,3, 3,1,1,3,3,3,3,3},
  337.     {'J',8, 3,3,3,3,3,2,3,3, 3,3,3,3,3,0,3,3, 3,3,3,3,3,0,0,3,
  338.             2,3,3,3,3,0,0,3, 1,1,1,1,1,1,1,3},
  339.     {'K',8, 2,3,3,3,2,3,3,3, 0,3,3,2,1,3,3,3, 0,0,1,1,1,1,0,3,
  340.             0,0,3,3,3,3,0,3, 1,1,3,3,3,3,1,3},
  341.     {'L',8, 2,3,3,3,3,3,3,3, 0,3,3,3,3,3,3,3, 0,0,3,3,3,3,3,3,
  342.             0,0,3,3,3,3,3,3, 1,1,1,1,1,1,1,3},
  343.     {'M',8, 2,2,2,2,2,2,2,3, 0,3,3,0,3,3,0,3, 0,0,3,0,3,3,0,3,
  344.             0,0,3,0,3,3,0,3, 1,1,3,1,3,3,1,3},
  345.     {'N',8, 2,2,2,2,2,2,2,3, 0,3,3,3,3,3,0,3, 0,0,3,3,3,3,0,3,
  346.             0,0,3,3,3,3,0,3, 1,1,3,3,3,3,1,3},
  347.     {'O',8, 2,2,2,2,2,2,2,3, 0,3,3,3,1,0,0,3, 0,3,3,3,3,3,0,3,
  348.             0,3,3,3,3,3,0,3, 1,1,1,1,1,1,1,3},
  349.     {'P',8, 2,2,2,2,2,2,2,3, 0,3,3,3,3,3,0,3, 0,0,1,1,1,1,1,3,
  350.             0,0,3,3,3,3,3,3, 1,1,3,3,3,3,3,3},
  351.     {'Q',8, 2,2,2,2,2,2,2,3, 0,3,3,3,3,3,0,3, 0,3,3,3,3,3,0,3,
  352.             0,3,3,3,2,2,0,3, 1,1,1,1,1,1,1,3},
  353.     {'R',8, 2,2,2,2,2,2,3,3, 0,3,3,3,3,0,3,3, 0,0,1,1,1,1,0,3,
  354.             0,0,3,3,3,3,0,3, 1,1,3,3,3,3,1,3},
  355.     {'S',8, 2,2,2,2,2,2,2,3, 0,3,3,3,3,3,1,3, 1,1,1,1,1,0,0,3,
  356.             2,3,3,3,3,0,0,3, 1,1,1,1,1,1,1,3},
  357.     {'T',8, 2,2,2,2,2,2,2,3, 3,3,3,0,3,3,3,3, 3,3,3,0,0,3,3,3,
  358.             3,3,3,0,0,3,3,3, 3,3,3,1,1,3,3,3},
  359.     {'U',8, 2,3,3,3,3,3,2,3, 0,3,3,3,3,3,0,3, 0,0,3,3,3,3,0,3,
  360.             0,0,3,3,3,3,0,3, 1,1,1,1,1,1,1,3},
  361.     {'V',8, 2,2,3,3,3,3,2,3, 0,0,3,3,3,3,0,3, 1,0,3,3,3,0,1,3,
  362.             3,0,3,3,3,0,3,3, 3,1,1,1,1,1,3,3},
  363.     {'W',8, 2,3,3,2,3,3,2,3, 0,3,3,0,3,3,0,3, 0,0,3,0,3,3,0,3,
  364.             0,0,3,0,3,3,0,3, 1,1,1,1,1,1,1,3},
  365.     {'X',8, 2,3,3,3,3,3,2,3, 0,3,3,3,3,3,0,3, 2,0,1,1,1,1,2,3,
  366.             0,0,3,3,3,3,0,3, 1,1,3,3,3,3,1,3},
  367.     {'Y',8, 2,3,3,3,3,3,2,3, 0,3,3,3,3,3,0,3, 1,1,1,0,0,1,1,3,
  368.             3,3,3,0,0,3,3,3, 3,3,3,1,1,3,3,3},
  369.     {'Z',8, 2,2,2,2,2,2,2,3, 3,3,3,3,3,3,0,3, 0,0,1,1,1,1,1,3,
  370.             0,0,3,3,3,3,3,3, 1,1,1,1,1,1,1,3},
  371.     {'0',8, 2,2,2,2,2,2,2,3, 0,3,3,3,3,3,0,3, 0,3,3,3,3,0,0,3,
  372.             0,3,3,3,3,0,0,3, 1,1,1,1,1,1,1,3},
  373.     {'1',5, 3,3,2,3,3,3,3,3, 3,3,0,3,3,3,3,3, 3,0,0,3,3,3,3,3,
  374.             3,0,0,3,3,3,3,3, 3,1,1,3,3,3,3,3},
  375.     {'2',8, 2,2,2,2,2,2,2,3, 1,3,3,3,3,3,0,3, 2,2,2,2,2,2,0,3,
  376.             0,0,3,3,3,3,2,3, 1,1,1,1,1,1,1,3},
  377.     {'3',8, 2,2,2,2,2,2,3,3, 1,3,3,3,3,0,3,3, 3,1,1,1,1,0,0,3,
  378.             2,3,3,3,3,0,0,3, 1,1,1,1,1,1,1,3},
  379.     {'4',8, 2,3,3,3,3,2,3,3, 0,3,3,3,3,0,3,3, 0,3,3,3,3,0,3,3,
  380.             1,1,1,1,0,0,1,3, 3,3,3,3,1,1,3,3},
  381.     {'5',8, 2,2,2,2,2,2,2,3, 0,3,3,3,3,3,3,3, 1,1,1,1,1,0,0,3,
  382.             2,3,3,3,3,0,0,3, 1,1,1,1,1,1,1,3},
  383.     {'6',8, 2,2,2,2,2,2,2,3, 0,3,3,3,3,3,1,3, 0,1,1,1,1,0,0,3,
  384.             0,3,3,3,3,0,0,3, 1,1,1,1,1,1,1,3},
  385.     {'7',8, 2,2,2,2,2,2,2,3, 3,3,3,3,3,3,0,3, 3,3,3,3,3,0,0,3,
  386.             3,3,3,3,3,0,0,3, 3,3,3,3,3,1,1,3},
  387.     {'8',8, 3,2,2,2,2,2,3,3, 3,0,3,3,3,0,3,3, 0,1,1,1,1,0,0,3,
  388.             0,3,3,3,3,0,0,3, 1,1,1,1,1,1,1,3},
  389.     {'9',8, 2,2,2,2,2,2,2,3, 0,3,3,3,3,3,0,3, 0,2,2,2,2,2,0,3,
  390.             3,3,3,3,3,0,0,3, 3,3,3,3,3,1,1,3},
  391.     {'-',5, 3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3, 0,0,0,0,3,3,3,3,
  392.             3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3},
  393.     {'`',4, 3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,
  394.             3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3},
  395.     {' ',5, 3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,
  396.             3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3},
  397.       };
  398.  
  399.  
  400.   // NOTE: the font-table automatically adjusts to the variable number
  401.   //       of elements in the font definition array's!
  402.  
  403.   static struct _font_tab {             // font table structure
  404.          short int  k;                  // (max) number of columns
  405.          short int  r;                  // number of rows (lines)
  406.          short int  n;                  // number of pattern entries
  407.          struct _b8x5 *d;               // pointer to font definition
  408.            } ft[] = {                   // FONT table
  409.          {0,0,0,NULL},                  // FONT0 dummy: suppress title
  410.          {6,3,sizeof(f1)/sizeof(struct _b8x5),f1}, // FONT1
  411.          {8,5,sizeof(f2)/sizeof(struct _b8x5),f2}, // FONT2
  412.          {8,4,sizeof(f3)/sizeof(struct _b8x5),f3}, // FONT3
  413.          {8,5,sizeof(f4)/sizeof(struct _b8x5),f4}, // FONT4
  414.            };
  415.  
  416.   static char a[80];                    // returned line buffer
  417.   static char b_array[]  = " ▄▀█░▌▐▒▓"; // block character elements
  418.                                         // codepage 437, 860, 863, 865
  419.   static char pg_multi[] = " ▄▀█░║║▒▓"; // Code Page 850: Multilingual
  420.  
  421.   if (c_info.codepage==850)            // codepage 850
  422.     strcpy(b_array,pg_multi);          // suitable blockchars
  423.  
  424.   if (f<FONT1 || f>FONT4)               // check range of selected font
  425.     f = FONT2;                          // reset to default if out of range
  426.  
  427.   if (k<LINE1 || k>ft[f].k-1)           // check range of LINE
  428.     k = LINE1;                          // prevent addressing violations
  429.  
  430.   i = 0;                                // zero count
  431.   w = 1;                                // width 1: leading char
  432.   while (i<n && b[i]!='\0' && w<=sizeof(a)) {   // limit width of output
  433.     for (j=0; j<ft[f].n &&
  434.               ft[f].d[j].c!=(char)toupper(b[i]); j++);   // search char
  435.     if (j < ft[f].n) {                  // found
  436.       if (w + ft[f].d[j].k < sizeof(a)) {    // would it fit?
  437.         w += ft[f].d[j].k;              // add active columns + 1 blank
  438.         ++i;                            // accept character
  439.         }                               // endif
  440.       else
  441.         n = i;                          // indicate 'full'
  442.       }                                 // endif
  443.     else {                              // not found
  444.       if (w + ft[f].k < sizeof(a)) {    // would dummy fit?
  445.         w += ft[f].k;                   // add max columns + 1 blank
  446.         ++i;                            // accept character
  447.         }                               // endif
  448.       else
  449.         n = i;                          // indicate 'full'
  450.       }                                 // endif
  451.     }                                   // endif
  452.   n = i;                                // maximum # title characters
  453.  
  454.   a[0] = b_array[(f==FONT4) ? 3 : 0];   // leading character
  455.   for (i=0,w=1; i<n; ++i) {             // process string up till n
  456.     for (j=0; j<ft[f].n &&
  457.               ft[f].d[j].c!=(char)toupper(b[i]); j++);  // search
  458.     if (j < ft[f].n) {                  // char found
  459.       a[w++] = b_array[ft[f].d[j].p[k].c0];
  460.       if (ft[f].d[j].k > 1)
  461.         a[w++] = b_array[ft[f].d[j].p[k].c1];
  462.       if (ft[f].d[j].k > 2)
  463.         a[w++] = b_array[ft[f].d[j].p[k].c2];
  464.       if (ft[f].d[j].k > 3)
  465.         a[w++] = b_array[ft[f].d[j].p[k].c3];
  466.       if (ft[f].d[j].k > 4)
  467.         a[w++] = b_array[ft[f].d[j].p[k].c4];
  468.       if (ft[f].d[j].k > 5)
  469.         a[w++] = b_array[ft[f].d[j].p[k].c5];
  470.       if (ft[f].d[j].k > 6)
  471.         a[w++] = b_array[ft[f].d[j].p[k].c6];
  472.       if (ft[f].d[j].k > 7)
  473.         a[w++] = b_array[ft[f].d[j].p[k].c7];
  474.       }
  475.     else {                              // char not found
  476.       --j;                              // take last character in table
  477.       for (x=0; x<ft[f].k; x++)         // max columns
  478.         a[w++] = b_array[ft[f].d[j].p[0].c0];    // filler block
  479.       }                                 // endfor
  480.     }                                   // endfor
  481.   a[(f==FONT4) ? w : w-1] = '\0';       // end of string
  482.   return(a);                            // return ptr to outputstring
  483.   }
  484.