15,976
社区成员
发帖
与我相关
我的任务
分享CFontDialog dlg;LOGFONT logFont = {0};
// set the font to default
//HFONT hFont = (HFONT)GetStockObject( DEFAULT_GUI_FONT );
//GetObject( hFont, sizeof(logFont), &logFont );
// set the font size
HDC hdc = ::GetDC(NULL);
int iLogPixelsY = ::GetDeviceCaps( hdc, LOGPIXELSY );
logFont.lfHeight = ::MulDiv( 12, iLogPixelsY, 72 );
// set font bold
logFont.lfWeight = FW_BOLD;
// set font style
MStrCopy( logFont.lfFaceName, _T("Calibri") );
g_font.CreateFontIndirect(&logFont); // create font