为什么我在api程序中创建了一个逻辑字体却不能显示中文用textout()输出中文时总显示乱码代码如下:
lfclew.lfHeight=15;
lfclew.lfWidth=0;
lfclew.lfEscapement=0;
lfclew.lfOrientation=0;
lfclew.lfWeight=1;
lfclew.lfItalic=0;
lfclew.lfUnderline=0;
lfclew.lfStrikeOut=0;
hfclew=CreateFontIndirect(&lfclew);
..............
holdfont=SelectObject(hdc,hfclew);
而如果选入另外一个创建的逻辑字体却能显示中文字体:
lf.lfHeight=15;
lf.lfWidth=5;
lf.lfEscapement=0;
lf.lfOrientation=0;
lf.lfWeight=1;
lf.lfItalic=0;
hfont=CreateFontIndirect(&lf);
...................... holdfont=SelectObject(hdc,hfont);请高手指点这是为什么呢,两种字体为什么不一样呢? 谢谢!
lfclew.lfHeight=15;
lfclew.lfWidth=0;
lfclew.lfEscapement=0;
lfclew.lfOrientation=0;
lfclew.lfWeight=1;
lfclew.lfItalic=0;
lfclew.lfUnderline=0;
lfclew.lfStrikeOut=0;
hfclew=CreateFontIndirect(&lfclew);
..............
holdfont=SelectObject(hdc,hfclew);
而如果选入另外一个创建的逻辑字体却能显示中文字体:
lf.lfHeight=15;
lf.lfWidth=5;
lf.lfEscapement=0;
lf.lfOrientation=0;
lf.lfWeight=1;
lf.lfItalic=0;
hfont=CreateFontIndirect(&lf);
...................... holdfont=SelectObject(hdc,hfont);请高手指点这是为什么呢,两种字体为什么不一样呢? 谢谢!
和strcpy(lf.lfFaceName,"Time New Roman");
后结果还是一样
两段代码在同一段程序中,Unicorn应该是一样的吧?
lf.lfCharSet = GB2312_CHARSET;
并用宋体等中文字体
Times New Roman吧!