• Advertisement

Archived

This topic is now archived and is closed to further replies.

MSVC embedding fonts?

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

Is it possible to embed a font directly into an executable? I am using the D3DXFont class to draw text in my game, however if i use any custom fonts they will not display correctly on computers that don''t have them installed. So can i embed the font? I know that i can create a bitmap of the fonts and embed that instead, but i''m looking for any easy way out here

Share this post


Link to post
Share on other sites
Advertisement
Why don''t you just put the font in the same directory that your executable is? Windows will check that directory (as well as the Windows\Fonts directory) when it tries to create a font. You could probably embed it as a resource, but I don''t know how you would load it, then.

Share this post


Link to post
Share on other sites
quote:
Original post by circlesoft
Why don''t you just put the font in the same directory that your executable is? Windows will check that directory (as well as the Windows\Fonts directory) when it tries to create a font. You could probably embed it as a resource, but I don''t know how you would load it, then.


are you sure about that? i was under the impression that it will only check the windows\fonts directory?

can anybody else confirm this?

Share this post


Link to post
Share on other sites
You have to use AddFontResource to add the font to the system font table, but then it will be usable as if it were in the windows font directory.

Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
quote:
Original post by DrunkenHyena
You have to use AddFontResource to add the font to the system font table, but then it will be usable as if it were in the windows font directory.


Thanks, that works great... just what i needed.

Nice tutorials on your site btw, i was reading them yesterday...

Share this post


Link to post
Share on other sites

  • Advertisement