/*---------------------------------------- EZTEST1.C -- EZFONT Test Program # 1 (c) Charles Petzold, 1994 ----------------------------------------*/ #include #include #include "ezfont.h" char szClass [] = "EzTest1" ; char szTitle [] = "EzTest1: EZFONT Test Program # 1" ; void PaintRoutine (HWND hwnd, HDC hdc, int cxArea, int cyArea) { CHAR szBuffer [64] ; HFONT hFont ; INT y, iDeciPtHeight ; TEXTMETRIC tm ; SetBkMode (hdc, TRANSPARENT) ; y = 0 ; for (iDeciPtHeight = 120 ; iDeciPtHeight <= 140 ; iDeciPtHeight ++) { hFont = EzCreateFont (hdc, "Times New Roman Bold", iDeciPtHeight, 0, 0, TRUE) ; SelectObject (hdc, hFont) ; GetTextMetrics (hdc, &tm) ; wsprintf (szBuffer, "This %d.%d point font is %d pixels high", iDeciPtHeight / 10, iDeciPtHeight % 10, tm.tmHeight - tm.tmInternalLeading) ; TextOut (hdc, 0, y, szBuffer, strlen (szBuffer)) ; SelectObject (hdc, GetStockObject (SYSTEM_FONT)) ; DeleteObject (hFont) ; y += tm.tmHeight - tm.tmInternalLeading ; } }