home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / GLEN / FONTFI.ZIP / MAKESHAD.C < prev    next >
Text File  |  1987-10-14  |  1KB  |  83 lines

  1. /**********************************
  2.  * MAKESHAD.C
  3.  *
  4.  * Make Shadow Fonts
  5.  *
  6.  * James Bumgardner 1987
  7.  **********************************/
  8.  
  9. #include <stdio.h>
  10. #include <ctype.h>
  11. #include "ffilters.h"
  12.  
  13. #define DEFAULT_SMEAR    10
  14.  
  15. process_font_header(smear)
  16. {
  17.     if (smear == 0)    smear = DEFAULT_SMEAR;
  18.     font_header.width += smear;
  19.     font_header.height += smear;
  20. }
  21.  
  22. process_char(h,w,smear)            /* Process pmap[0] --> pmap[1] */
  23. {
  24.     register int y,x;
  25.     register char i,sflg;
  26.  
  27.     if (smear == 0)    smear = DEFAULT_SMEAR;
  28.  
  29.     char_header.width += smear;
  30.     char_header.height += smear;
  31.     char_header.delta_x += smear;
  32.  
  33.     for (y = 0; y < h + smear; ++y)    /* Blank Output */
  34.         for (x = 0; x < w + smear+8; ++x)
  35.             pmap[1][y][x] = 0;
  36.  
  37.     for (i = smear-1; i >= 0; --i)
  38.         for (y = 0; y < h; ++y)
  39.         for (x = 0; x < w; ++x)
  40.             if (pmap[0][y][x])
  41.             pmap[1][y+i][x+i] = (i == 0)? 0 : 1;
  42.  
  43.     /*
  44.      * fill in North West Outlines - remove the
  45.      * following portion of code
  46.      * to make another interesting font
  47.          */
  48.  
  49.     for (y = 0; y < h; ++y)
  50.     {
  51.         sflg = 0;
  52.         for (x = 0; x < w; ++x)
  53.         {
  54.             if (pmap[0][y][x])
  55.             {
  56.                 if (sflg == 0)
  57.                 {
  58.                     pmap[1][y][x] = 1;
  59.                     sflg = 1;
  60.                 }
  61.             }
  62.             else    sflg = 0;
  63.         }
  64.     }
  65.  
  66.     for (x = 0; x < w; ++x)
  67.     {
  68.         sflg = 0;
  69.         for (y = 0; y < h; ++y)
  70.         {
  71.             if (pmap[0][y][x])
  72.             {
  73.                 if (sflg == 0)
  74.                 {
  75.                     pmap[1][y][x] = 1;
  76.                     sflg = 1;
  77.                 }
  78.             }
  79.             else    sflg = 0;
  80.         }
  81.     }
  82. }
  83.