-
Notifications
You must be signed in to change notification settings - Fork 0
/
VF07.C
43 lines (32 loc) · 1.36 KB
/
VF07.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*--------------------------------------------------
VF07.C -- Display characters with sheared shadow
--------------------------------------------------*/
#define INCL_GPI
#include <os2.h>
#include "vectfont.h"
VOID Display_Shadow (HPS hps, LONG cxClient, LONG cyClient)
{
unsigned char szText[] = "Shadow" ;
static LONG cbText = sizeof szText - 1 ;
POINTL ptl, ptlShear ;
SIZEF sizfx ;
CreateVectorFont (hps, LCID_MYFONT, "Tms Rmn Italic") ;
GpiSetCharSet (hps, LCID_MYFONT) ;
ScaleFontToBox (hps, cbText, szText, 3 * cxClient / 4, cyClient) ;
QueryStartPointInTextBox (hps, cbText, szText, &ptl) ;
ColorClient (hps, cxClient, cyClient, CLR_BLUE) ;
GpiSavePS (hps) ;
ptlShear.x = 200 ; // Set char shear
ptlShear.y = 100 ;
GpiSetCharShear (hps, &ptlShear) ;
GpiQueryCharBox (hps, &sizfx) ;
sizfx.cy += sizfx.cy / 4 ; // Set char box
GpiSetCharBox (hps, &sizfx) ;
GpiSetColor (hps, CLR_DARKBLUE) ;
GpiCharStringAt (hps, &ptl, cbText, szText) ; // Display shadow
GpiRestorePS (hps, -1L) ;
GpiSetColor (hps, CLR_RED) ;
GpiCharStringAt (hps, &ptl, cbText, szText) ; // Display text
GpiSetCharSet (hps, LCID_DEFAULT) ; // Clean up
GpiDeleteSetId (hps, LCID_MYFONT) ;
}