home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 4
/
BUGCD1997_05.BIN
/
aplic
/
clip4win
/
clip4win.exe
/
C4W30E.HUF
/
SOURCE
/
FONT2.PRG
< prev
next >
Wrap
Text File
|
1995-05-26
|
959b
|
48 lines
#include "windows.ch"
#define NO_C4WCLASS
#include "commands.ch"
static nX := 10, nY := 10
function main()
local oApp, oWnd
CREATE APPLICATION oApp WINDOW oWnd TITLE "Clip-4-Win: CREATE FONT Test" ;
ON WM_PAINT TestFonts(oWnd)
return 0
static function TestFonts(hWnd)
local hDC := GetDC(hWnd), hFont, hOldFont
nY := 10
Out(hDC, "Arial", , 20)
Out(hDC, "Courier", , 20)
Out(hDC, "Arial", 14)
Out(hDC, "Courier", 14)
ReleaseDC(hWnd, hDC)
return nil
static function Out(hDC, cFont, nPt, nH)
local hFont, hOldFont, cStr
if nPt != nil
CREATE FONT HANDLE hFont FACE cFont POINTSIZE nPt DC hDC
cStr = cFont + " POINTSIZE " + ltrim(str(nPt))
elseif nH != nil
CREATE FONT HANDLE hFont FACE cFont HEIGHT nH
cStr = cFont + " HEIGHT " + ltrim(str(nH))
endif
hOldFont = SelectObject(hDC, hFont)
TextOut(hDC, nX, nY += 40, cStr)
SelectObject(hDC, hOldFont)
DELETE FONT HANDLE hFont
return nil