• Advertisement
Sign in to follow this  

Loading a font

This topic is 4462 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 want to load a font situed in a directory called 'data/'. the D3DXCreateFont function requires a font name, not a path. How can I do to load a font from a specific directory? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Have a look at AddFontResource. It allows you to add a font file in any location to the system font table. Then, D3DXCreateFont will be able to find it by font name.

Share this post


Link to post
Share on other sites
Bad news :(

When I use the function, my app crashes.

AddFontResource("data/AgencyB.TTF");

Any idea?

Share this post


Link to post
Share on other sites
The application freezes or simple quits when I call AddFontResource() which is documented to return an integer but when I want to check it I receive the compilator message 'void value not ignored as it ought to be'. Apparently, it returns nothing...

Share this post


Link to post
Share on other sites
The prototype in WinGDI.h definitely shows this function as returning an int. So, if you're compiler says it returns void, then you've got something wacked with your installation.

What compiler are you using?

Share this post


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

  • Advertisement