views:

1424

answers:

4

This is probably noob territory but what the heck:

I want to embed fonts in my winforms application so that I don't have to worry about them being installed on the machine. I've searched a bit on the MSDN site and found a few hints about using native Windows API calls, for instance Michael Caplans (sp?) tutorial linked to by Scott Hanselman. Now, do I really have to go through all that trouble? Can't I just use the resource part of my app?

If not I'll probably go the installing route. In that case, can I do that programmatically? By just copying the font file to the Windows\Fonts folder?

Edit: I am aware of licencing issues, thanks for the concern though.

A: 

You could do that, but also be aware that like software fonts too have licenses and you need to ensure that you are not violating any licenses that prohibit embedding and deployment.

Conrad
A: 

Can't I just use the resource part of my app?

Yes, but need to be native resources rather than .NET resources (i.e. using rc.exe, the native resource compiler).

Richard
+1  A: 

You can do that, Refer following...

http://dotnet-coding-helpercs.blogspot.com

A: 

Described in following article, with code sample: http://c-sharpening.blogspot.com/2010/09/embedding-font-to-resources.html

Ernest