Click here to Skip to main content
Rate this: bad
good
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-84480

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 at 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 at 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
0 OriginalGriff 431
1 Afzaal Ahmad Zeeshan 184
2 /\jmot 176
3 Sergey Alexandrovich Kryukov 175
4 Marcin Kozub 175
0 OriginalGriff 8,344
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,634
3 Maciej Los 5,024
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 16 Jun 2013
Copyright © CodeProject, 1999-2014
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