首先,这是一个MFC的Bug
http://connect.microsoft.com/VisualStudio/feedback/details/505466/mfc-visual-style-font-size-too-small-to-display-chinese-character-clearly-on-windows-xp
解决时间暂时还不确定, 临时的方案如下:
App在 InitInstance中加入:
注释:
字体的设置保存在一个全局变量afxGlobalData中,此变量定义AfxGlobals.h中。
AFX_GLOBAL_DATA中有一个SetMenuFont可以设定字体属性,影响 Menu、Toolbar、Dock Pane等的caption字体。
但是这个设置对 tooltip无影响,临时解决:在上面代码基础上在加入
ps:经尝试,依然无法改变输出窗口的字体问题,期待更加完美的解决方案,最好还是微软感觉补丁一下....
个人觉得是不是应该把这段程序放在MainFrm的PreCreateWindow函数里面...
http://connect.microsoft.com/VisualStudio/feedback/details/505466/mfc-visual-style-font-size-too-small-to-display-chinese-character-clearly-on-windows-xp
MFC visual style font size too small to display chinese character clearly on Windows XP When A MFC application which use visual style run on Windows Xp,the chinese character in menu and the tab item of output window can not display clearly.The chinese character in the tab item of output window can not display clearly even if it run on vista.
AFX_GLOBAL_DATA::UpdateFonts should be modified to increase the min font height. For example,the LOGFONT::lfHeight of Tahoma can not be less then -12 or +13 if you want to diplay chinese character clearly.
解决时间暂时还不确定, 临时的方案如下:
App在 InitInstance中加入:
LOGFONT logfont = {0};
:: SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &logfont, 0);
afxGlobalData.SetMenuFont(&logfont,true);
注释:
字体的设置保存在一个全局变量afxGlobalData中,此变量定义AfxGlobals.h中。
AFX_GLOBAL_DATA中有一个SetMenuFont可以设定字体属性,影响 Menu、Toolbar、Dock Pane等的caption字体。
但是这个设置对 tooltip无影响,临时解决:在上面代码基础上在加入
if(afxGlobalData.fontTooltip.GetSafeHandle() != NULL)
{
::DeleteObject(afxGlobalData.fontTooltip.Detach());
}
afxGlobalData.fontTooltip.CreateFontIndirect(&logfont);
ps:经尝试,依然无法改变输出窗口的字体问题,期待更加完美的解决方案,最好还是微软感觉补丁一下....
个人觉得是不是应该把这段程序放在MainFrm的PreCreateWindow函数里面...