Jump to content
  • Advertisement


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



This topic is 6016 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

im using the id3dxfont interface to create a font engine, but im not really sure how to use gdi functions like CreateFont(). HFONT hFont = CreateFont( tempHeight, 0, 0, 0, FW_REGULAR, FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, VARIABLE_PITCH|FF_DONTCARE, "Century Gothic" ); thats what my function call looks like, and i think the problem may be that i dont understand the "null terminated string" part.

Share this post

Link to post
Share on other sites
No, you shouldn''t need to add the explicit null char at the end of the string. In C/C++, all strings embedded in your program (e.g. "a string") will automatically get a null character added to the end.

The problem may be that the font you requested simply was not available, either by that name, or in that point size. The problem might also be that the font was not available given your request via the parameters OUT_TT_PRECIS (try OUT_DEFAULT_PRECIS) and/or ANTIALIASED_QUALITY (try NONANTIALIASED_QUALITY).

If you want to see which fonts are available, you could enumerate the fonts using EnumFontFamilies - see docs for details.

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!