// use LOGFONT structure to add a font.
LOGFONT lfont;
lfont.lfHeight = 55;
lfont.lfWidth = 0;
lfont.lfEscapement = 0;
lfont.lfOrientation = 0;
lfont.lfWeight = FW_BOLD;
lfont.lfItalic = 0;
lfont.lfUnderline = 0;
lfont.lfStrikeOut = 0;
lfont.lfCharSet = ANSI_CHARSET;
lfont.lfOutPrecision = OUT_DEFAULT_PRECIS;
lfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
// lfQuality Specifies the output quality. Use ANTIALIASED_QUALITY!
lfont.lfQuality = ANTIALIASED_QUALITY;
lfont.lfPitchAndFamily = VARIABLE_PITCH | FF_ROMAN;
lstrcpy(lfont.lfFaceName,"Arial");
HFONT oldfont, hfont_antialias = CreateFontIndirect(&lfont);
oldfont = (HFONT)SelectObject(hdc, hfont_antialias);
TextOut(hdc, 100, 100, "This is an antialiased text", 27);
//.... and so on .... |