How to install a font along with installation of my application in C#?

Posted on 2009-02-17
Last Modified: 2013-11-07
I have developed an application with c# and I'm making a setup for it. I need to install a special font with my application. I found a code in Internet which I include it in Code part but it give me an error that it doesn't know FontInstall.
Would you please help me solve it or give me another way of doing the job.

Thanks in advance.
int Ret; 

int Res; 

string FontPath; 

const int WM_FONTCHANGE = 0x001D; 

const int HWND_BROADCAST = 0xffff; 

FontPath = WinFontDir + "\" + FontFileName; 

Ret = FontInstall.AddFontResource(FontPath); 

Res = FontInstall.SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0); 

Ret = FontInstall.WriteProfileString("fonts", FontName + " (TrueType)", FontFileName);

Open in new window

Question by:Elham_Seif
    LVL 53

    Expert Comment

    Perhaps you can add the font as an resource to your project.
    LVL 69

    Accepted Solution

    You can include your font into your Setup Package if you have one and it will automatically be deployed.

    Also have a look at

    Author Closing Comment

    This simple sentence was my answer:
    In the « File System », add the « Fonts Folder » and add your font files to it. Those fonts will automatically be deployed to the right folder

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    This video discusses moving either the default database or any database to a new volume.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now