关于LOGFONT和CreateFontIndirect的问题
ddeng 2001-08-21 05:26:30 请问LOGFONT结构中的lfWidth究竟该怎么设?我该将它设成多少才能和设为0时输出结果一样?
设为0时是正常的,而按照下面方法设置的输出竟然比设为0时扁一些,为什么?
LOGFONT lf;
ZeroMemory(&lf, sizeof(LOGFONT));
lf.lfCharSet = GB2312_CHARSET;
strcpy(lf.lfFaceName, "ËÎÌå");
lf.lfEscapement = 0;
lf.lfOrientation = 0;
lf.lfWeight = FW_NORMAL;
lf.lfHeight = -100;
lf.lfWidth = -lf.lfHeight*72/GetDeviceCaps(Canvas->Handle, LOGPIXELSY);
Canvas->Font->Handle = ::CreateFontIndirect(&lf);
Canvas->TextOut(300, 200, "好");