返回> 网站首页
字体对话框默认字体字号
 yoours2012-01-07 20:26:30
yoours2012-01-07 20:26:30
      
      
简介一边听听音乐,一边写写文章。
 CClientDC dc(this);
 LOGFONT lf;
 memset(&lf, 0, sizeof(LOGFONT));
 lf.lfCharSet = DEFAULT_CHARSET;//字符集
 lf.lfHeight = -MulDiv(12, dc.GetDeviceCaps(LOGPIXELSY), 72);// 12号
 lf.lfWeight = FW_NORMAL;// FW_BOLD
 _tcscpy_s(lf.lfFaceName, LF_FACESIZE, _T("宋体"));
 CFontDialog fdlg(&lf);
 if (IDOK == fdlg.DoModal())
 {
  LOGFONT lf1;
  fdlg.GetCurrentFont(&lf1);
  // -lf.lfHeight 转字号
  TRACE("字号:%d\n", -lf1.lfHeight - ((-lf1.lfHeight) / 4) - (-lf1.lfHeight%4>1?1:0));
 }
文章评论
1998人参与,0条评论