我用如下方法创建字体为"宋体".
CFont nFont; 
nFont.CreateFont(m_fontHeight,m_fontWith,0,0,0,FALSE,FALSE,0,0,0,0,0,0,_TEXT("宋体"));//创建字体问:这样的话在其他国家如日本,韩国,中东等国家的语言的系统下显示他们国家的文字,会有问题吗? 会不会因为他们国家没有"宋体"而乱码?

解决方案 »

  1.   

    如果你使用UNICODE编码,会选取一种接近的字体来显示,如果没有接近的中文字体,就会出现乱码;如果没有使用UNICODE编码,就是乱码。
      

  2.   

    我是用UNICODE编码.我设置宋体字体,在韩文系统下显示韩文,会不会乱码?
      

  3.   


    //应该不会,如果系统字库中没有宋体,会找最接近的字体代替。lpszFacename
    A CString or pointer to a null-terminated string that specifies the typeface name of the font. The length of this string must not exceed 30 characters. The Windows EnumFontFamilies function can be used to enumerate all currently available fonts. If lpszFacename is NULL, the GDI uses a device-independent typeface.