Annotation of pmsdk/samples/vectfont/vf06.c, revision 1.1.1.1

1.1       root        1: /*----------------------------------------------------------
                      2:    VF06.C -- Display seven different character shear angles
                      3:   ----------------------------------------------------------*/
                      4: 
                      5: #define INCL_GPI
                      6: #include <os2.h>
                      7: #include <stdio.h>
                      8: #include "vectfont.h"
                      9: 
                     10: VOID Display_CharShear (HPS hps, LONG cxClient, LONG cyClient)
                     11:      {
                     12:      static POINTL aptlShear[7] = { -100,  41, -100, 100,
                     13:                                      -41, 100,    0, 100,
                     14:                                       41, 100,  100, 100,
                     15:                                      100,  41 } ;
                     16:      CHAR          szBuffer[40] ;
                     17:      FONTMETRICS   fm ;
                     18:      INT           iIndex ;
                     19:      POINTL        ptl ;
                     20: 
                     21:                          // Create and scale Helvetica font
                     22: 
                     23:      CreateVectorFont (hps, LCID_MYFONT, "Helv") ;
                     24:      GpiSetCharSet (hps, LCID_MYFONT) ;
                     25:      ScaleVectorFont (hps, 480, 480) ;
                     26: 
                     27:                          // Get font metrics for scaled font
                     28: 
                     29:      GpiQueryFontMetrics (hps, (LONG) sizeof (FONTMETRICS), &fm) ;
                     30: 
                     31:      ptl.x = cxClient / 8 ;
                     32:      ptl.y = cyClient ;
                     33: 
                     34:      for (iIndex = 0 ; iIndex < 7 ; iIndex++)
                     35:           {
                     36:           GpiSetCharShear (hps, aptlShear + iIndex) ;  // Char shear
                     37: 
                     38:           ptl.y -= fm.lMaxBaselineExt ;
                     39: 
                     40:           GpiCharStringAt (hps, &ptl,
                     41:                (LONG) sprintf (szBuffer, "Character Shear (%ld,%ld)",
                     42:                          aptlShear[iIndex].x, aptlShear[iIndex].y),
                     43:                szBuffer) ;
                     44:           }
                     45:      GpiSetCharSet (hps, LCID_DEFAULT) ;               // Clean up
                     46:      GpiDeleteSetId (hps, LCID_MYFONT) ;
                     47:      }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.