Jump to content
  • Advertisement
Sign in to follow this  
schupf

D3DXCreateFont: Available Fonts

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

Hello,

I render text with D3DX in my DX 9 application. The fonts are created per D3DXCreateFont:

http://msdn.microsoft.com/en-us/library/windows/desktop/bb172773(v=vs.85).aspx

There is a parameter ( [color=#000000][font=Consolas, Courier, monospace]

LPCTSTR pFacename ) [/font]that specifies the used font, something like "Arial". But how do I know which fonts are available on the system? I am targeting XP,Vista and 7.
Is there a list of Fonts that are always available on these systems?

BTW: Do you have a tip about a font that is suitiable for a game (something that looks a little bit round)?

Share this post


Link to post
Share on other sites
Advertisement
Thanks!

I just noticed something strange: I wanted to try out some fonts, but the text always looked the same. So I made a test and passed a wrong font name string ("foobar") to [color=#000000][font=Consolas, Courier, monospace]

D3DXCreateFont [/font]and the function still returned S_OK! How is that possible? Does the function just use a default font (Arial?) when you pass a font the function
does not accept? But how can passing a standard font like "Courier New Bold"? not work?

Share this post


Link to post
Share on other sites
Windows GDI will substitute a font if it can't find an exact match. For "Courier New Bold", you should use "Courier New" as the face name, and set the Weight to FW_BOLD.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!