Sign in to follow this  

can I use CreateScalableFontResource here

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

This topic is 4717 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this