本文整理汇总了C++中CFontDialog::GetFaceName方法的典型用法代码示例。如果您正苦于以下问题:C++ CFontDialog::GetFaceName方法的具体用法?C++ CFontDialog::GetFaceName怎么用?C++ CFontDialog::GetFaceName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFontDialog
的用法示例。
在下文中一共展示了CFontDialog::GetFaceName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnFonts
void CVisualSynanView::OnFonts()
{
CFontDialog dlgFonts;
if( dlgFonts.DoModal() != IDOK)
return;
LOGFONT lfOldFont;
LogFontCpy(&lfOldFont, m_LogFontForWords);
dlgFonts.GetCurrentFont(&m_LogFontForWords);
CString str = dlgFonts.GetFaceName();
CClientDC dc(this);
EnumFontFamiliesEx(dc.m_hDC, &m_LogFontForWords, &TestIfTrueTypeEx,(LPARAM)this,0);
if( !m_bExistUsefulFont )
{
::AfxMessageBox(IDS_NOT_TRUE_TYPE);
LogFontCpy(&m_LogFontForWords,lfOldFont);
return;
}
if(!(m_LogFontForWords.lfCharSet & RUSSIAN_CHARSET) )
{
::AfxMessageBox(IDS_NOT_RUSSIAN_CHARSET);
LogFontCpy(&m_LogFontForWords,lfOldFont);
return;
};
// m_LogFontForWords has changed!!
UpdateFontsFromLogFont();
CClientDC clDC(this);
Recalculate(clDC);
Invalidate();
}
示例2: sfont
void mydialog::sfont()
{
CFontDialog dlg;
CString str;
int size;
long style;
CFont ff;
int i=dlg.DoModal();
if(i==IDCANCEL)
return;
str=dlg.GetFaceName();
size=dlg.GetSize();
LOGFONT lf;
lf.lfHeight =dlg.GetSize();
memset(&lf,0,sizeof lf);
str=dlg.GetFaceName();
if(dlg.IsItalic())
lf.lfItalic =1;
if(dlg.IsUnderline())
lf.lfUnderline=1;
if(dlg.IsBold())
lf.lfWeight=700;
if(dlg.IsStrikeOut())
lf.lfStrikeOut=1;
lf.lfHeight =size/10+10;
char s[32]="Arial";
strcpy(lf.lfFaceName,str);
ff.CreateFontIndirect(&lf);
e1.SetWindowText("dfdfsdfsfsd");
e1.SetFont(&ff);
}
示例3: OnOptionsSetfont
/////////////////////////////////////
// @mfunc menu handler - display a window font selection dialog and set font attributes for style at caret position
// @rvalue void | not used
//
void CScintillamfcView::OnOptionsSetfont()
{
CFontDialog dlg;
if (dlg.DoModal() == IDOK)
{
m_wndScintilla.SetFontname(m_wndScintilla.GetCurrentStyle(), dlg.GetFaceName());
m_wndScintilla.SetFontheight(m_wndScintilla.GetCurrentStyle(), dlg.GetSize()/10);
m_wndScintilla.SetBold(m_wndScintilla.GetCurrentStyle(), dlg.IsBold());
m_wndScintilla.SetItalic(m_wndScintilla.GetCurrentStyle(), dlg.IsItalic());
m_wndScintilla.SetUnderline(m_wndScintilla.GetCurrentStyle(), dlg.IsUnderline());
}
}
示例4: OnButtonSelectFont
void DlgSetPrintStyle::OnButtonSelectFont()
{
// TODO: Add your control notification handler code here
CFontDialog cfd;
cfd.m_cf.Flags |= ( CF_NOSTYLESEL | CF_NOSIZESEL);
if (cfd.DoModal() == IDOK)
{
m_strFont = cfd.GetFaceName();
m_wndFontName.SetWindowText(m_strFont);
}
}
示例5: OnCustomFontTextBrowse
void CfgAppearanceFontDlg::OnCustomFontTextBrowse(void)
{
xpr_tchar_t sFont[MAX_FONT_TEXT + 1] = {0};
GetDlgItemText(IDC_CFG_FONT_CUSTOM_FONT_TEXT, sFont, MAX_FONT_TEXT);
LOGFONT sLogFont = {0};
StringToLogFont(sFont, sLogFont);
CFontDialog sDlg;
sDlg.m_cf.Flags &= ~CF_EFFECTS;
sDlg.m_cf.Flags |= CF_INITTOLOGFONTSTRUCT;
memcpy(sDlg.m_cf.lpLogFont, &sLogFont, sizeof(LOGFONT));
if (sDlg.DoModal() == IDOK)
{
xpr_tchar_t sText[MAX_FONT_TEXT + 1] = {0};
FontDlgToString(sDlg.GetFaceName(), sDlg.GetSize(), sDlg.GetWeight(), sDlg.IsItalic(), sDlg.IsStrikeOut(), sDlg.IsUnderline(), sText);
SetDlgItemText(IDC_CFG_FONT_CUSTOM_FONT_TEXT, sText);
setModified();
}
}