Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

kollesofthome

Changing the font used in a editbox

This topic is 5815 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to change the font used in one of my editboxes. I''ve written like this: CFont m_fntBoldComic; ZeroMemory (&lfNew, sizeof(LOGFONT)); lfNew.lfHeight = 18; lfNew.lfWeight = FW_THIN; strcpy (lfNew.lfFaceName, "Comic Sans MS"); m_fntBoldComic.CreateFontIndirect(&lfNew); m_textbox.SetFont(&m_fntBoldComic, TRUE); The font changes but not to Comic Sans MS size 18 but a system bold font. What''s wrong?

Share this post


Link to post
Share on other sites
Advertisement
Try setting the charset - lfCharSet = DEFAULT_CHARSET; - and leaving the height and weight to default (0). Then add those items back one at a time checking each change to identify the source of the problem.

Share this post


Link to post
Share on other sites
umm..
If CFont m_fntBoldComic; goes out of scope try changing it to
static CFont m_fntBoldComic;

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!