• Advertisement
Sign in to follow this  

Loading TTF fonts as resource

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

My code here applies to Direct3D, but the question regards the Win32 font loading routines. By default, CreateFont looks for fonts in the %windows%/font folder, but what if I want to load a font as a resource from within one of my datafiles? In the end I don't want the end user to be able to replace the texture and / or copy it on the fly. A long time before these forums were cleaned, I asked the same question in the NeHe forum and got my answer, but I'm not able to find that post anymore. So my final question within this bunch of jiddering text: How do I load (ttf) fonts like a resource?

Share this post


Link to post
Share on other sites
Advertisement
I've never used it, but it looks like you can use AddFontMemResourceEx to add your font to the font-table, then use CreateFont as normal.

Share this post


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

  • Advertisement