Share via


CFontDialog::GetCurrentFont

Call this function to assign the characteristics of the currently selected font to the members of a LOGFONT structure.

void GetCurrentFont( 
   LPLOGFONT lplf  
);

Parameters

  • lplf
    A pointer to a LOGFONT structure.

Remarks

Other CFontDialog member functions are provided to access individual characteristics of the current font.

If this function is called during a call to DoModal, it returns the current selection at the time (what the user sees or has changed in the dialog). If this function is called after a call to DoModal (only if DoModal returns IDOK), it returns what the user actually selected.

Example

// Get the characteristics of the currently selected font, if any.
CFontDialog dlg;
if (dlg.DoModal() == IDOK)
{
   LOGFONT lf;
   dlg.GetCurrentFont(&lf);
   TRACE(_T("Face name of the selected font = %s\n"), lf.lfFaceName);
}

Requirements

Header: afxdlgs.h

See Also

Reference

CFontDialog Class

Hierarchy Chart

CFontDialog::GetFaceName

CFontDialog::GetStyleName