-
Notifications
You must be signed in to change notification settings - Fork 0
/
VF01.C
51 lines (40 loc) · 1.77 KB
/
VF01.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
44
45
46
47
48
49
50
51
/*-----------------------------------------
VF01.C -- Display 24-point vector fonts
-----------------------------------------*/
#define INCL_GPI
#include <os2.h>
#include <string.h>
#include "vectfont.h"
VOID Display_24Point (HPS hps, LONG cxClient, LONG cyClient)
{
static CHAR *szFacename[] = {
"Courier", "Courier Italic",
"Courier Bold", "Courier Bold Italic",
"Tms Rmn", "Tms Rmn Italic",
"Tms Rmn Bold", "Tms Rmn Bold Italic",
"Helv", "Helv Italic",
"Helv Bold", "Helv Bold Italic"
} ;
static INT iNumFonts = sizeof szFacename / sizeof szFacename[0] ;
FONTMETRICS fm ;
INT iFont ;
POINTL ptl ;
ptl.x = cxClient / 8 ;
ptl.y = cyClient ;
for (iFont = 0 ; iFont < iNumFonts ; iFont++)
{
// Create font, select it and scale
CreateVectorFont (hps, LCID_MYFONT, szFacename[iFont]) ;
GpiSetCharSet (hps, LCID_MYFONT) ;
ScaleVectorFont (hps, 240, 240) ;
// Get font metrics for scaled font
GpiQueryFontMetrics (hps, (LONG) sizeof (FONTMETRICS), &fm) ;
ptl.y -= fm.lMaxBaselineExt ;
// Display the font facename
GpiCharStringAt (hps, &ptl, (LONG) strlen (szFacename[iFont]),
(PCCH) szFacename[iFont]) ;
GpiCharString (hps, 10L, (PCCH) " - abcdefg") ;
GpiSetCharSet (hps, LCID_DEFAULT) ; // Clean up
GpiDeleteSetId (hps, LCID_MYFONT) ;
}
}