home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / compiler / small_c / cb / sources / fnt.c < prev    next >
Encoding:
C/C++ Source or Header  |  1985-09-14  |  2.8 KB  |  86 lines

  1. /*
  2. ** fnt.c -- choose FX printer font
  3. */
  4. #include <stdio.h>
  5. #include "tools.h"
  6. #define NOCCARGC
  7. char
  8.    condensed[]={27, 15, 0},
  9.   xcondensed[]={    18, 0},
  10.    double[]={27, 'G', 0},
  11.   xdouble[]={27, 'H', 0},
  12.    elite[]={27, 'M', 0},
  13.   xelite[]={27, 'P', 0},
  14.    emphasized[]={27, 'E', 0},
  15.   xemphasized[]={27, 'F', 0},
  16.    enlarged[]={27, 'W', 49, 0},
  17.   xenlarged[]={27, 'W', 48, 0},
  18.    italics[]={27, '4', 0},
  19.   xitalics[]={27, '5', 0},
  20.    pica[]={27, 'P', 0},
  21.   xpica[]={27, 'M', 0},
  22.    subscript[]={27, 'S', 49, 0},
  23.   xsubscript[]={27, 'T', 0},
  24.    superscript[]={27, 'S', 48, 0},
  25.   xsuperscript[]={27, 'T', 0},
  26.    proportional[]={27, 'p', 49, 0},
  27.   xproportional[]={27, 'p', 48, 0};
  28. char str[15], *ptr="prn";
  29. int i, fd;
  30. main(argc, argv) int argc, *argv; {
  31.   if(getarg(1, str, 15, argc, argv) != EOF) ptr = str;
  32.   if(*str == '-') {
  33.     fputs("usage: FNT [device]", stderr);
  34.     abort(7);
  35.     }
  36.   if((fd=fopen(ptr, "w")) == 0) cant(ptr);
  37.   do {
  38.     fputs(CLEAR, stdout);
  39.     fputs("    Select Epson FX Option (RETURN to exit)\n\n", stdout);
  40.     fputs("set  clear   mode\n\n", stdout);
  41.     fputs(" 1     2     condensed    \n", stdout);
  42.     fputs(" 3     4     double strike\n", stdout);
  43.     fputs(" 5     6     elite\n", stdout);
  44.     fputs(" 7     8     emphasized   \n", stdout);
  45.     fputs(" 9    10     enlarged\n", stdout);
  46.     fputs("11    12     italics\n", stdout);
  47.     fputs("13    14     pica\n", stdout);
  48.     fputs("15    16     subscript\n", stdout);
  49.     fputs("17    18     superscript\n", stdout);
  50.     fputs("19    20     proportional\n", stdout);
  51.     fputs("\nselect... ", stdout);
  52.     fgets(str, 10, stdin);
  53.     ptr = str;
  54.     while(*ptr) {
  55.       if(*ptr == '\n') *ptr=NULL;
  56.       ++ptr;
  57.       }
  58.     if(utoi(str, &i)) {
  59.       switch(i) {
  60.         case  1: {fputs( condensed, fd); break;}
  61.         case  2: {fputs(xcondensed, fd); break;}
  62.         case  3: {fputs( double, fd); break;}
  63.         case  4: {fputs(xdouble, fd); break;}
  64.         case  5: {fputs( elite, fd); break;}
  65.         case  6: {fputs(xelite, fd); break;}
  66.         case  7: {fputs( emphasized, fd); break;}
  67.         case  8: {fputs(xemphasized, fd); break;}
  68.         case  9: {fputs( enlarged, fd); break;}
  69.         case 10: {fputs(xenlarged, fd); break;}
  70.         case 11: {fputs( italics, fd); break;}
  71.         case 12: {fputs(xitalics, fd); break;}
  72.         case 13: {fputs( pica, fd); break;}
  73.         case 14: {fputs(xpica, fd); break;}
  74.         case 15: {fputs( subscript, fd); break;}
  75.         case 16: {fputs(xsubscript, fd); break;}
  76.         case 17: {fputs( superscript, fd); break;}
  77.         case 18: {fputs(xsuperscript, fd); break;}
  78.         case 19: {fputs( proportional, fd); break;}
  79.         case 20: {fputs(xproportional, fd); break;}
  80.         }
  81.       }
  82.     } while (*str);
  83.   }
  84. #include "cant.c"
  85.  
  86.