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

  1. /*------------------------------------------------------
  2.    VF03.C -- Display four strings in mirror reflections
  3.   ------------------------------------------------------*/
  4.  
  5. #define INCL_GPI
  6. #include <os2.h>
  7. #include "vectfont.h"
  8.  
  9. VOID Display_Mirror (HPS hps, LONG cxClient, LONG cyClient)
  10.      {
  11.      static CHAR szText[] = "Mirror" ;
  12.      static LONG cbText = sizeof szText - 1 ;
  13.      INT         i ;
  14.      POINTL      ptl ;
  15.      SIZEF       sizfx ;
  16.                                    // Create font, select and scale
  17.  
  18.      CreateVectorFont (hps, LCID_MYFONT, "Tms Rmn Italic") ;
  19.      GpiSetCharSet (hps, LCID_MYFONT) ;
  20.      ScaleFontToBox (hps, cbText, szText, cxClient / 2, cyClient / 2) ;
  21.  
  22.      ptl.x = cxClient / 2 ;        // Center of client window
  23.      ptl.y = cyClient / 2 ;
  24.  
  25.      for (i = 0 ; i < 4 ; i++)
  26.           {
  27.           GpiQueryCharBox (hps, &sizfx) ;
  28.  
  29.           if (i == 1 || i == 3)
  30.                sizfx.cx *= -1 ;
  31.                                    // Negate char box dimensions
  32.           if (i == 2)
  33.                sizfx.cy *= -1 ;
  34.  
  35.           GpiSetCharBox (hps, &sizfx) ;
  36.  
  37.           GpiCharStringAt (hps, &ptl, cbText, szText) ;
  38.           }
  39.      GpiSetCharSet (hps, LCID_DEFAULT) ;          // Clean up
  40.      GpiDeleteSetId (hps, LCID_MYFONT) ;
  41.  
  42.      }
  43.