home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / basic / PGL.ZIP / PGLCS.ZIP / FONT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-20  |  1.7 KB  |  64 lines

  1. /*
  2. *    FONT.C - PGL Font demo program
  3. */
  4. #include <stdlib.h>
  5. #include <stdio.h>
  6. #include "pgl.h"
  7.  
  8. void textfonts      ( void );
  9.  
  10. main()
  11. {
  12.    int err=0;
  13.  
  14.    pgInitDrw( "font.plt", 2000, 2000, &err );
  15.    if( err != 0 )
  16.    {
  17.       printf( "ERROR IN INITDRW ROUTINE" );
  18.       exit( 1 );
  19.    }
  20.    pgSetColor( 1 );
  21.  
  22.    textfonts();
  23.  
  24.    pgEndDrw();
  25. }
  26. /*
  27.  *****************************************************************************
  28.  ***   FUNCTION TEXTFONTS                                                  ***
  29.  *****************************************************************************
  30.  ***                                                                       ***
  31.  ***   This function tests the various font sets.                          ***
  32.  ***                                                                       ***
  33.  *****************************************************************************
  34.  *****************************************************************************
  35. */
  36. void textfonts()
  37.  
  38. {
  39.    int midx;
  40.  
  41.    midx = pgGetMaxX()/2;
  42.    pgSetTextScaling( 5, 1, 5, 1 );
  43.    pgSetTextJustify( pgCENTER, pgBOTTOM );
  44.    pgDrawTextXY( midx, 250, "Default Font Set (pgSMALL)" );
  45.  
  46.    pgSetTextStyle( pgSIMPLEX );
  47.    pgDrawTextXY( midx, 500, "Simplex Font Set" );
  48.  
  49.    pgSetTextStyle( pgDUPLEX );
  50.    pgDrawTextXY( midx, 750, "Duplex Font Set" );
  51.  
  52.    pgSetTextStyle( pgTRIPLEX );
  53.    pgDrawTextXY( midx, 1000, "Triplex Font Set" );
  54.  
  55.    pgSetTextStyle( pgGOTHIC );
  56.    pgDrawTextXY( midx, 1250, "Gothic Font Set" );
  57.  
  58.    pgSetTextStyle( pgSCRIPT );
  59.    pgDrawTextXY( midx, 1500, "Script Font Set" );
  60.  
  61.    pgSetTextStyle( pgSDUPLEX );
  62.    pgDrawTextXY( midx, 1750, "Script Duplex Font Set" );
  63. }
  64.