Installing a font using C#

  • Thread starter Thread starter Johan Mårtensson
  • Start date Start date
J

Johan Mårtensson

Hi

I was wondering if anyone knows how to install a system font using C#?
I know it doesn´t do the trick to simply copy the font to the font
directory, it just doesn´t become active.

Any ideas?

/Johan
 
Hej Johan!

Antar att du är Svensk men jag svarar på Engelska i alla fall...

I was wondering if anyone knows how to install a system font using C#?
I know it doesn´t do the trick to simply copy the font to the font
directory, it just doesn´t become active.

You need to first copy the font file to a directory, e.g. %winddir%\Fonts
and then call the Win32 function AddFontResource()

More info here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_9r51.asp


// Anders
 
Back
Top