home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / GLEN / L3SAMP.ZIP / REVERSE.C < prev    next >
Text File  |  1989-09-28  |  2KB  |  101 lines

  1. /****************************************************************/
  2. /* reverse.c                                                      */
  3. /*                                                              */
  4. /* patterned fonts on a black rule background using print model    */
  5. /* (CG times shadowed vertically in landscape mode)                */
  6. /*                                                                 */
  7. /* Date : 9-27-89                                                */
  8. /****************************************************************/
  9.  
  10. #include <stdio.h>
  11. #include <fcntl.h>
  12.  
  13. int description();
  14.  
  15. FILE *prn;
  16.  
  17. main()
  18.  
  19. { /* beginning of main program */
  20.  
  21. /* initialization section */
  22.  
  23. int point_size=200, i,
  24.     shading, count=1, xoffset, yoffset;
  25.  
  26. prn = fopen("lpt1","wb");                   /* open lpt1 for writing */
  27.  
  28. /* printer initialization */
  29.  
  30. fprintf(prn,"\33E");                         /* send an esc E to reset printer */
  31.  
  32. fprintf(prn,"\33&l1O");                     /* enable landscape mode */
  33.  
  34. fprintf(prn,"\33&a10L");                     /* set left margin */
  35.  
  36. fprintf(prn,"\33*p250x225Y");                  /* set cursor position */
  37.  
  38. fprintf(prn,"\33*c3000a1200B");              /* set rule size in dots */
  39.  
  40. fprintf(prn,"\33*c0P");                      /* print rule */
  41.  
  42. /* landscape printout */
  43.  
  44. fprintf(prn,"\33*p350x1200Y");              /* set cursor position */
  45.  
  46. fprintf(prn,"\33*v0n1O");                    /* source = transp, pattern = opaque */
  47.  
  48. fprintf(prn,"\33(s1p%dv1s3b5T"
  49.             ,point_size);                      /* font select by attribute */
  50.  
  51. fprintf(prn,"Reverse");
  52.  
  53.  
  54. for (i=0;i<100;i=i+5)
  55.     {
  56.     /* shaded print */
  57.  
  58.     fprintf(prn,"\33*p350x1200Y");          /* set cursor position */
  59.  
  60.     count++;
  61.  
  62.     xoffset=count*15;
  63.  
  64.     yoffset=count*10;
  65.  
  66.     shading=100-i;
  67.  
  68.     fprintf(prn,"\33*p-%dY",yoffset);          /* set cursor position */
  69.  
  70.     fprintf(prn,"\33*c%dG",shading);        /* select % shading */
  71.  
  72.     fprintf(prn,"\33*v2T");                    /* select HP shading pattern */
  73.  
  74.     fprintf(prn,"\33(s1p%dv1s3b5T"
  75.                 ,point_size);                  /* font select by attribute */
  76.  
  77.     fprintf(prn,"Reverse");
  78.     }
  79.  
  80. fprintf(prn,"\r\33*p1800Y");                /* cursor position */
  81.  
  82. fprintf(prn,"\33*c100G",shading);            /* select % shading */
  83.  
  84. fprintf(prn,"\33*v2T");                        /* select HP shading pattern */
  85.  
  86. description();
  87.  
  88. fprintf(prn,"\f");                            /* formfeed */
  89.  
  90. }
  91.  
  92. description()
  93. {
  94. fprintf(prn,"\33(s1p12v1s0b4101T");            /* select 12 pt CG Times Italic */
  95.  
  96. fprintf(prn,"Patterned fonts on a "
  97.             "black rule background.\n\n\r"
  98.             "- Shadowed CG Times\n\r"
  99.             "- Incremental Vertical Movement\n\r"
  100.             "- Opaque Pattern Transparency");
  101. }