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

  1. /*------------------------------------------
  2.    VF04.C -- Display eight character angles
  3.   ------------------------------------------*/
  4.  
  5. #define INCL_GPI
  6. #include <os2.h>
  7. #include <stdio.h>
  8. #include "vectfont.h"
  9.  
  10. VOID Display_CharAngle (HPS hps, LONG cxClient, LONG cyClient)
  11.      {
  12.      static GRADIENTL agradl[8] = { 100,    0,  100,  100,
  13.                                       0,  100, -100,  100,
  14.                                    -100,    0, -100, -100,
  15.                                       0, -100,  100, -100 } ;
  16.      CHAR             szBuffer[40] ;
  17.      INT              iIndex ;
  18.      POINTL           ptl ;
  19.  
  20.                               // Create Helvetica font
  21.  
  22.      CreateVectorFont (hps, LCID_MYFONT, "Helv") ;
  23.      GpiSetCharSet (hps, LCID_MYFONT) ;
  24.      ScaleVectorFont (hps, 200, 200) ;
  25.  
  26.      ptl.x = cxClient / 2 ;   // Center of client window
  27.      ptl.y = cyClient / 2 ;
  28.  
  29.      for (iIndex = 0 ; iIndex < 8 ; iIndex++)
  30.           {
  31.           GpiSetCharAngle (hps, agradl + iIndex) ;     // Char angle
  32.  
  33.           GpiCharStringAt (hps, &ptl,
  34.                (LONG) sprintf (szBuffer, " Character Angle (%ld,%ld)",
  35.                                agradl[iIndex].x, agradl[iIndex].y),
  36.                szBuffer) ;
  37.           }
  38.      GpiSetCharSet (hps, LCID_DEFAULT) ;               // Clean up
  39.      GpiDeleteSetId (hps, LCID_MYFONT) ;
  40.      }
  41.