CFont font ;
font.Create();请问如何填参才能创建宋体9号字啊

解决方案 »

  1.   

    LOGFONT m_lf;
    m_lf.lfWidth = 200;
    m_lf.lfHeight = 200;
    m_lf.lfCharSet = GB2312_CHARSET;
    m_lf.lfOutPrecision = 3;
    m_lf.lfClipPrecision = 2;
    m_lf.lfQuality = PROOF_QUALITY;
    m_lf.lfPitchAndFamily = 49;
    m_lf.lfEscapement = 0;
    m_lf.lfOrientation = 0;
    m_lf.lfUnderline = 0;
    m_lf.lfPitchAndFamily = DEFAULT_PITCH|FF_ROMAN;
             m_lf.Weight=9;
             m_lf.StrikeOut=  //删除线
             m_lf.Italic=   //斜体
             m_lf.lfFaceName="宋体"
    CFont TempFont;
    TempFont.CreateFontIndirect( &m_lf );
      

  2.   

    LOGFONT lf;
    memset(&lf, 0, sizeof(LOGFONT));       
    lf.lfHeight = 9;                      
    strcpy(lf.lfFaceName, "宋体");        
    VERIFY(m_font.CreateFontIndirect(&lf));  // create the font