我编写了一个读取dxf文件程序,其中当读到字符串时我就用textout输出字串,问题在于如果子串中有中文,textout就显示乱码,问什么?程序如下:
CFont font;
LOGFONT lf;
lf.lfHeight = height * 10;//从文件中读出的字符高度
lf.lfWeight = FW_NORMAL;
lf.lfItalic = 0;
lf.lfEscapement = escapement;//从文件中读出的字符角度
lf.lfOrientation = orientation;//从文件中读出的文字角度
lf.lfUnderline = 0;
lf.lfStrikeOut = 0;
strcpy(lf.lfFaceName,"宋体");
font.CreatePointFontIndirect(&lf); CFont * oldfont = pDC->SelectObject(&font);
pDC->TextOut(x,-y,strtext);/strtext就是从文件中读出字串 pDC->SelectObject(oldfont);我用debug调试时strtext变量中的确有中文,但输出后就乱了