关于LOGFONT

扫码查看
本文介绍了关于LOGFONT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!
我想知道:CFont类的CreateFont方法中的nHeight字段与LOGFONT 结构的lfHeight字段之间是否有区别?因为当我通过2种方式创建字体时:
1,

everyone!
I am wondering that: are there any differences between nHeight field in CreateFont method of CFont class and lfHeight field of LOGFONT structure? Because when I create a font by 2 ways:
1,

//other codes
CFont myFont;
myFont.CreateFont(m_iSize, 0, 0, 0, 400, m_bItalic, m_bUnder, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH|FF_SWISS, m_strFont);
//other codes


2,


2,

//other codes
CFontDialog fontDlg;
int iOption = fontDlg.DoModal();
if (iOption!=IDOK)
{
	return;
}
LOGFONT logFont;
fontDlg.GetCurrentFont(&logFont);
CFont myFont;
myFont.CreateFontIndirect(&logFont);
//other codes


在这里:当然,我必须传递等于在FontDialog中选择的m_iSize,m_bItalic,bUnder,m_strFont.但是我收到的2种字体是不同的,至少是它的大小.
请为我解释!

非常感谢!


HERE: certainly I must pass m_iSize, m_bItalic, bUnder, m_strFont equals to the selection in FontDialog. But 2 fonts I received are different, at least is its size.
Please explain for me!

Thanks so much!

推荐答案



我已将相关部分加粗.

您的情况是否有可能发生?

我应该说,我已经好几年没有使用C,C ++或MFC了,所以任何后续问题都将浪费您的时间. :)

我只是出于某种奇怪的原因而想起了.

祝你好运! :)



I have bolded the relevant bit.

Is there a possibility that this is happening in your case?

I should say that I have not used C, C++ or MFC for years and years so any follow-up questions would be a waste of your time. :)

I just remembered this, for some odd reason.

Good luck! :)


这篇关于关于LOGFONT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 11:23
查看更多