// Create a new font so we can change it later CFont * f = GetFont(); CFont newfont; LOGFONT lf; if(f != NULL) { /* Set up duplicate font */ f->GetObject(sizeof(LOGFONT), &lf); // change font size & bold style with lf here. ... newfont.CreateFontIndirect(&lf); } /* Set up duplicate font */ else { /* Use default font spec */ newfont.CreateStockObject(ANSI_VAR_FONT); } /* Use default font spec */ SetFont(newfont); newfont.Detach();
CFont * f = GetFont();
CFont newfont;
LOGFONT lf;
if(f != NULL)
{ /* Set up duplicate font */
f->GetObject(sizeof(LOGFONT), &lf);
// change font size & bold style with lf here.
...
newfont.CreateFontIndirect(&lf);
} /* Set up duplicate font */
else
{ /* Use default font spec */
newfont.CreateStockObject(ANSI_VAR_FONT);
} /* Use default font spec */
SetFont(newfont);
newfont.Detach();