Click here to Skip to main content
12,069,536 members (65,380 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C++ Windows
To define the required font in the static control I use the CreateFont() function:
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:
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 15-Jun-13 14:53pm
Igor-84675

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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[^]
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web04 | 2.8.160208.1 | Last Updated 16 Jun 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100