通过CFontDialog给CRichEditCtrl设置默认字体,
要取得原来的字体并修改,只使用字体和大小
CHARFORMAT 的数据和CFontDialog 的字体高度如何对应

解决方案 »

  1.   

    CHARFORMAT cf =GetCharFormat();    nPointSize *=20; 
        cf.yHeight =nPointSize;

        cf.dwMask =CFM_SIZE;   SetSelectionCharFormat(cf);
      

  2.   

    这个我知道啊,CHARFORMAT 的数据和CFontDialog 的字体高度如何对应
      

  3.   

    void CRichEditView::OnFormatFont()
    {
    GetCharFormatSelection();
    CFontDialog dlg(m_charformat, CF_BOTH|CF_NOOEMFONTS);
    if (dlg.DoModal() == IDOK)
    {
    dlg.GetCharFormat(m_charformat);
    SetCharFormat(m_charformat);
    }
    }