Jump to content
  • Advertisement
Sign in to follow this  
egwenejs

can I use CreateScalableFontResource here

This topic is 4931 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'm trying to load a custom true type font. I'm pretty sure the way do it is: CreateScalableFontResource (....); AddFontResource (....); SendMessage (HWND_BROADCAST, WM_FONTCHANGE, 0, 0); The docs are confusing me as to what I should use for the params of the first two functions. Or if there's a better way, I would like to know it also. Thanks in advance for your help.

Share this post


Link to post
Share on other sites
Advertisement
OK, nevermind I figured it after taking a nice little break. And here what's up with this in case someone else wants to use it.

when initializing --
CreateScalableFontResource (0, "MyCustomFont.fot", "MyCustomFont.ttf", NULL);
AddFontResource ("MyCustomFont.fot");

then you can use "MyCustomFont" as a new font face when Creating Fonts because you just temporialy installed it.

when your finished
RemoveFontResource ("MyCustomFont.fot");
SendMessage (HWND_BROADCAST, WM_FONTCHANGE, 0, 0);

the broadcast message is just in case some app pick it up somewhere in between

This to me seems easier than making a bitmap font engine and less a .ttf file is smaller than a .bmp file. Anyways laters.

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.

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!