|
|
1.1 ! root 1: /*-------------------------------------------------- ! 2: VF07.C -- Display characters with sheared shadow ! 3: --------------------------------------------------*/ ! 4: ! 5: #define INCL_GPI ! 6: #include <os2.h> ! 7: #include "vectfont.h" ! 8: ! 9: VOID Display_Shadow (HPS hps, LONG cxClient, LONG cyClient) ! 10: { ! 11: static CHAR szText[] = "Shadow" ; ! 12: static LONG cbText = sizeof szText - 1 ; ! 13: POINTL ptl, ptlShear ; ! 14: SIZEF sizfx ; ! 15: ! 16: CreateVectorFont (hps, LCID_MYFONT, "Tms Rmn Italic") ; ! 17: GpiSetCharSet (hps, LCID_MYFONT) ; ! 18: ScaleFontToBox (hps, cbText, szText, 3 * cxClient / 4, cyClient) ; ! 19: QueryStartPointInTextBox (hps, cbText, szText, &ptl) ; ! 20: ! 21: ColorClient (hps, cxClient, cyClient, CLR_BLUE) ; ! 22: ! 23: GpiSavePS (hps) ; ! 24: ! 25: ptlShear.x = 200 ; // Set char shear ! 26: ptlShear.y = 100 ; ! 27: GpiSetCharShear (hps, &ptlShear) ; ! 28: ! 29: GpiQueryCharBox (hps, &sizfx) ; ! 30: sizfx.cy += sizfx.cy / 4 ; // Set char box ! 31: GpiSetCharBox (hps, &sizfx) ; ! 32: ! 33: GpiSetColor (hps, CLR_DARKBLUE) ; ! 34: GpiCharStringAt (hps, &ptl, cbText, szText) ; // Display shadow ! 35: ! 36: GpiRestorePS (hps, -1L) ; ! 37: ! 38: GpiSetColor (hps, CLR_RED) ; ! 39: GpiCharStringAt (hps, &ptl, cbText, szText) ; // Display text ! 40: ! 41: GpiSetCharSet (hps, LCID_DEFAULT) ; // Clean up ! 42: GpiDeleteSetId (hps, LCID_MYFONT) ; ! 43: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.