home *** CD-ROM | disk | FTP | other *** search
- #include<windows.h>
- #include<string.h>
- class WinFont {
- LOGFONT lf;
- HFONT hFont;
- public:
- WinFont(void) {
- memset(&lf,0,sizeof(LOGFONT));
- hFont = NULL;
- }
- void Create(void) { hFont = CreateFontIndirect(&lf); }
- HFONT GetHandle(void) { return hFont; }
- void SetFontWeight(int weight) { lf.lfWeight = weight; }
- void SetFontCharSet(BYTE charset) { lf.lfCharSet = charset; }
- void SetFontPitchAndFamily(BYTE pnf) { lf.lfPitchAndFamily = pnf; }
- void SetFontHeight(int height) { lf.lfHeight = height; }
- void SetFontWidth(int width) { lf.lfWidth = width; }
- void SetFontName(char *name) { strcpy((char *)lf.lfFaceName, name); }
- };