Tech Support > Microsoft Windows > Development Resources > Getting bold text - opposite to CreateFontIndirect?
Getting bold text - opposite to CreateFontIndirect?
Posted by gw7rib@aol.com on April 2nd, 2008


I'm attempting some simple text formatting. Using SetTextColor to
change the colour of the text is straight-forward and seems to be
working fine. But it seems harder to get bold text.

As I understand it, I can create a font using CreateFontIndirect,
specifying a weight of FW_BOLD, and this will come out bold. But is
there a function which does the opposite, ie which will load up a
LOGFONT structure with details of the current font, so that I can just
alter the ones I want to change?

Thanks in advance.
Paul.

Posted by Scott Seligman on April 2nd, 2008


gw7rib@aol.com wrote:
You can use GetObject to get the LOGFONT structure used to
create a HFONT.

--
--------- Scott Seligman <scott at <firstname> and michelle dot net> ---------
Whenever you find yourself on the side of the majority, it is time to
pause and reflect.
-- Mark Twain

Posted by gw7rib@aol.com on April 3rd, 2008


On 3 Apr, 00:45, "Scott Seligman" <selig...@example.com> wrote:
Thanks very much. I've used GetObject (plus GetCurrentObject to get
the value to feed in) and it's working fine. Thanks for your help.

Paul.


Similar Posts