home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / LASER / XFNTFILT.ZIP / MAKEHOLL.C < prev    next >
Encoding:
C/C++ Source or Header  |  1988-01-13  |  1.2 KB  |  70 lines

  1. /**********************************
  2.  * MAKEHOLLOW.C
  3.  *
  4.  * Make HP Fonts Hollow
  5.  *
  6.  * James Bumgardner 1987
  7.  **********************************/
  8.  
  9. #include <stdio.h>
  10. #include <ctype.h>
  11.  
  12. void process_font_header(int);
  13. void process_char(int h, int w, int unused);
  14.  
  15. #include "ffilters.h"
  16.  
  17. void process_font_header(int unused)
  18. {
  19.     /* nada */
  20. }
  21.  
  22. void process_char(int h, int w, int unused)    /* Process pmap[0] --> pmap[1] */
  23. {
  24.     register int y,x;
  25.     register char sflg;
  26.  
  27.     for (y = 0; y < h; ++y)    /* Blank Output */
  28.         for (x = 0; x < w; ++x)
  29.             pmap[1][y][x] = 0;
  30.  
  31.     for (y = 0; y < h; ++y) {        /* Mark Horizontal Edges */
  32.         sflg = 0;
  33.         for (x = 0; x < w; ++x) {
  34.             if (pmap[0][y][x]) {
  35.                 if (sflg == 0) {
  36.                     pmap[1][y][x] = 1;
  37.                     sflg = 1;
  38.                 }
  39.             }
  40.             else {
  41.                 if (sflg) {
  42.                     pmap[1][y][x-1] = 1;
  43.                     sflg = 0;
  44.                 }
  45.             }
  46.         }
  47.         if (sflg)    pmap[1][y][x-1] = 1;
  48.     }
  49.  
  50.     for (x = 0; x < w; ++x) {
  51.         sflg = 0;
  52.         for (y = 0; y < h; ++y) {        /* Mark Vertical Edges */
  53.             if (pmap[0][y][x]) {
  54.                 if (sflg == 0) {
  55.                     pmap[1][y][x] = 1;
  56.                     sflg = 1;
  57.                 }
  58.             }
  59.             else {
  60.                 if (sflg) {
  61.                     pmap[1][y-1][x] = 1;
  62.                     sflg = 0;
  63.                 }
  64.             }
  65.         }
  66.         if (sflg)
  67.             pmap[1][y-1][x] = 1;
  68.     }
  69. }
  70.