RE: Re: Default Font Bolded

"Nenad Stefanovic" <[email protected]>
Newsgroups gmane.comp.windows.wtl
Message-ID <001e01cac0b6$10a7e560$31f7b020$@com>
Hi Yarp,

 

The "default" font for DC is SYSTEM_FONT, which is bold-only bitmap font
(the one you can see in WinDiff). You *don't* want to use that font. So, you
have to create and select a font before drawing text.

 

For general discussion about fonts:

There is nothing wrong with AtlGetDefaultGuiFont() if you understand that it
is not a universal font solution. It gives you the font which is the same as
"MS Shell Dlg". The better solution for applications is to use desired font
directly.

 

Using fonts from NONCLIENTMETRICS is OK for their intended use, but not for
something else. For example, if you have Edit-based view window, and you use
Caption font, then your Edit view font will depend on the user setting for
the Caption font. The same for other fonts in NONCLIENTMETRICS.

 

OldNewThing blog has fantastic information, but is sometimes hard to
understand. Here is another excellent blog discussing these topics:

 

                http://blogs.msdn.com/michkap/archive/2006/06/11/626100.aspx

                http://blogs.msdn.com/michkap/archive/2006/03/18/554308.aspx

 

All this reminded me that we should review and make sure that font handling
in WTL is correct. We will do that.

 

Cheers,

Nenad

 

 

From: [email protected] [mailto:[email protected]] On Behalf Of yarp
Sent: Wednesday, March 10, 2010 12:41 AM
To: [email protected]
Subject: [wtl] Re: Default Font Bolded

 

  

Seems like I ran into an interesting problem. 
The first lesson is not to use AtlGetDefaultGuiFont anymore.
And the second one is to write a new wrapper.

Thank you for the links that OldNewThing blog is a real blessing I should
visit it more often.

Yarp

--- In [email protected] <mailto:wtl%40yahoogroups.com> , "ntufarellich"
<ntufarelli@...> wrote:
>
> Take a look at these:
> 
> http://blogs.msdn.com/oldnewthing/archive/2005/07/07/436435.aspx
> 
> and 
> 
> http://msdn.microsoft.com/en-us/library/dd144925(VS.85).aspx
> 
> The documentation of GetStockObject function on MSDN (the second link)
says:
> 
> It is not recommended that you employ this method to obtain the current
font used by dialogs and windows. Instead, use the SystemParametersInfo
function with the SPI_GETNONCLIENTMETRICS parameter to retrieve the current
font. SystemParametersInfo will take into account the current theme and
provides font information for captions, menus, and message dialogs.
> 





[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.