Skip to content

Instantly share code, notes, and snippets.

@mrcaron
Created September 17, 2009 17:20
Show Gist options
  • Save mrcaron/188599 to your computer and use it in GitHub Desktop.
Save mrcaron/188599 to your computer and use it in GitHub Desktop.
Sets up unicode font in a rich text edit control for MFC
/* SET UNICODE FONT */
CDC *pDC = GetDC();
LOGFONT lf;
memset(&lf, 0, sizeof(lf));
lf.lfHeight = MulDiv(20, ::GetDeviceCaps(pDC->m_hDC, LOGPIXELSY), 72);
lf.lfWeight = FW_NORMAL;
lf.lfOutPrecision = OUT_TT_ONLY_PRECIS;
wcscpy(lf.lfFaceName, _T("Lucida Sans Unicode"));
CFont font;
font.CreateFontIndirect(&lf);
iEqnRichEditControl.SetFont(&font);
ReleaseDC(pDC);
/* END UNICODE SETUP */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment