MFC CreateFont的nEscapement参数设置字体显示方向无效【win7 profession service pack1系统,中文系统正常】

qq_35084700 2016-12-28 10:27:24
CreateFont部分代码如下
for (int i = 0; i < 4; i++)
{
m_cFont[i].CreateFont(
m_nFontSize[i], // nHeight
0, // nWidth
900*i, // nEscapement
0, // nOrientation
FW_HEAVY, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
DEFAULT_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
NULL);
}

软件在win7 win8中文版系统运行都正常,最近测试win7 professional service pack1,这个字体方向的设置没有产生效果
...全文
642 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_35084700 2016-12-29
  • 打赏
  • 举报
回复
英文系统用LOGFONT可以达到改变文字显示方向的效果,但软件在中文系统下字体大小设置不一样显示出来却是一样大,代码如下: LOGFONT m_lf[4]; for (int i = 0; i < 4; i++) { m_lf[i].lfHeight = m_nFontSize[i];; m_lf[i].lfWidth = 0; m_lf[i].lfEscapement = 900 * i; m_lf[i].lfOrientation = 0; m_lf[i].lfWeight = FW_HEAVY; m_lf[i].lfItalic = FALSE; m_lf[i].lfUnderline = FALSE; m_lf[i].lfStrikeOut = FALSE; m_lf[i].lfCharSet = DEFAULT_CHARSET; m_lf[i].lfOutPrecision = OUT_DEFAULT_PRECIS; m_lf[i].lfClipPrecision = CLIP_DEFAULT_PRECIS; m_lf[i].lfQuality = DEFAULT_QUALITY; m_lf[i].lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS; strcpy(m_lf[i].lfFaceName, "@system"); } 暂时的解决办法是通过获取系统语言来决定用CreateFont还是LOGFONT,依然不知道问题出在哪,求大神支招
paschen 2016-12-28
  • 打赏
  • 举报
回复
nEscapement [in] The angle, in tenths of degrees, between the escapement vector and the x-axis of the device. The escapement vector is parallel to the base line of a row of text. When the graphics mode is set to GM_ADVANCED, you can specify the escapement angle of the string independently of the orientation angle of the string's characters. When the graphics mode is set to GM_COMPATIBLE, nEscapement specifies both the escapement and orientation. You should set nEscapement and nOrientation to the same value. https://msdn.microsoft.com/en-us/library/windows/desktop/dd183499
qq_35084700 2016-12-28
  • 打赏
  • 举报
回复
引用 1 楼 paschen 的回复:
nEscapement [in] The angle, in tenths of degrees, between the escapement vector and the x-axis of the device. The escapement vector is parallel to the base line of a row of text. When the graphics mode is set to GM_ADVANCED, you can specify the escapement angle of the string independently of the orientation angle of the string's characters. When the graphics mode is set to GM_COMPATIBLE, nEscapement specifies both the escapement and orientation. You should set nEscapement and nOrientation to the same value. https://msdn.microsoft.com/en-us/library/windows/desktop/dd183499
依然不知道问题出在哪儿。。。求明示

3,882

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 其它技术问题
社区管理员
  • 其它技术问题社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧