Click here to Skip to main content
15,910,981 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
To define the required font in the static control I use the CreateFont() function:
C++
HFONT hNewFont = CreateFont(
16,
0,
0,
0,
FW_DONTCARE,
0,
0,
0,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
//CLIP_DEFAULT_PRECIS,
CLIP_STROKE_PRECIS,
CLEARTYPE_QUALITY,
FF_MODERN | FIXED_PITCH,
"Tahoma");

and set it for control:
C++
SendMessage(hStatic,WM_SETFONT,(WPARAM)hNewFont,true);

Ok, it's works fine.
Created font have white shadow or contour, I don't know.
On a white background everything looks good:
<img src="http://s017.radikal.ru/i423/1306/5b/0aaf4cd215c8.png">
, but on the black background - it is visible white shadow from text:
<img src="http://s019.radikal.ru/i611/1306/cb/221dfed5786e.png"></img>
So how to disable or to cut this white text shadow?
Posted

1 solution

I have never used CreateFont function though, but try changing CLEARTYPE_QUALITY to NONANTIALIASED_QUALITY or others in CreateFont Function

http://msdn.microsoft.com/en-us/library/windows/desktop/dd183499(v=vs.85).aspx[^]
 
Share this answer
 
Comments
Igor-84 16-Jun-13 10:31am    
saad_lah, and what methods and functions do you use usually for setting up a font for the static control?
P Uday kishore 18-Jun-13 0:45am    
CFont staticfont= new CFont;
staticfont->CreatePointFont(105, _T("Lucida Grande Bold"));

apply the font using
"control variable.setfont(staticfont);"

this method works good.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900