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

  1. /*----------------------------------------------------------
  2.    VF02.C -- Display vector font stretched to client window
  3.   ----------------------------------------------------------*/
  4.  
  5. #define INCL_GPI
  6. #include <os2.h>
  7. #include "vectfont.h"
  8.  
  9. VOID Display_Stretch (HPS hps, LONG cxClient, LONG cyClient)
  10.      {
  11.      static CHAR szText[] = "Hello!" ;
  12.      static LONG cbText = sizeof szText - 1 ;
  13.      POINTL      ptl ;
  14.  
  15.                               // Create font, select, and scale
  16.  
  17.      CreateVectorFont (hps, LCID_MYFONT, "Tms Rmn Italic") ;
  18.      GpiSetCharSet (hps, LCID_MYFONT) ;
  19.      ScaleFontToBox (hps, cbText, szText, cxClient, cyClient) ;
  20.      QueryStartPointInTextBox (hps, cbText, szText, &ptl) ;
  21.  
  22.      GpiCharStringAt (hps, &ptl, cbText, szText) ;     // Display text
  23.  
  24.      GpiSetCharSet (hps, LCID_DEFAULT) ;               // Clean up
  25.      GpiDeleteSetId (hps, LCID_MYFONT) ;
  26.      }
  27.