home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / S12219.ZIP / VF12.C < prev    next >
C/C++ Source or Header  |  1988-11-29  |  1KB  |  43 lines

  1. /*------------------------------------------------------
  2.    VF12.C -- Fading font with various pattern densities
  3.   ------------------------------------------------------*/
  4.  
  5. #define INCL_GPI
  6. #include <os2.h>
  7. #include "vectfont.h"
  8.  
  9. VOID Display_Fade (HPS hps, LONG cxClient, LONG cyClient)
  10.      {
  11.      static CHAR szText[] = "Fade" ;
  12.      static LONG cbText = sizeof szText - 1 ;
  13.      LONG        lPattern ;
  14.      POINTL      ptl ;
  15.  
  16.      CreateVectorFont (hps, LCID_MYFONT, "Tms Rmn Italic") ;
  17.      GpiSetCharSet (hps, LCID_MYFONT) ;
  18.      ScaleFontToBox (hps, cbText, szText, cxClient, cyClient) ;
  19.      QueryStartPointInTextBox (hps, cbText, szText, &ptl) ;
  20.  
  21.      GpiSetBackMix (hps, BM_OVERPAINT) ;
  22.  
  23.      for (lPattern = 8 ; lPattern >= 1 ; lPattern--)
  24.           {
  25.           GpiBeginPath (hps, ID_PATH) ;
  26.           GpiCharStringAt (hps, &ptl, cbText, szText) ;     // Text out
  27.           GpiEndPath (hps) ;
  28.  
  29.           GpiSetPattern (hps, lPattern) ;
  30.           GpiFillPath (hps, ID_PATH, FPATH_ALTERNATE) ;     // Fill path
  31.  
  32.           ptl.x += 2 ;
  33.           ptl.y -= 2 ;
  34.           }
  35.  
  36.      GpiSetPattern (hps, PATSYM_SOLID) ;
  37.      GpiSetBackMix (hps, BM_LEAVEALONE) ;
  38.      GpiCharStringAt (hps, &ptl, cbText, szText) ;          // Solid
  39.  
  40.      GpiSetCharSet (hps, LCID_DEFAULT) ;                    // Clean up
  41.      GpiDeleteSetId (hps, LCID_MYFONT) ;
  42.      }
  43.