4

Is there any way to include font to a clickOnce installation of a winforms application in visual studio. The program that we are developing requires a font that is not installed in windows by default.

Jargo
  • 365
  • 1
  • 4
  • 16
  • 1
    For anyone who stumbles on this in the future: There is a similar topic with more up-to-date and better answers regarding this issue- http://stackoverflow.com/questions/3007805/embedding-deploying-custom-font-in-net-app/3008351 – Brady Aug 27 '15 at 18:38

3 Answers3

2

Can you create a setup & deployment project to install the font, and deploy it as a prerequisite to the ClickOnce application. You can turn it into a custom prerequisite by using the Bootstrapper Manifest Generator to create the prerequisite package, copy into the VS packages folder, and it will show up in Visual Studio as a prerequisite.

almog.ori
  • 7,839
  • 1
  • 35
  • 49
RobinDotNet
  • 11,723
  • 3
  • 30
  • 33
0

You can load the font into a res file and have it loaded without being installed to the computer.

See:

Andrew Morton
  • 24,203
  • 9
  • 60
  • 84
Mitch
  • 21,223
  • 6
  • 63
  • 86
  • Unfortunately that won't help since we need to actually install the font on the computer. – Jargo Jan 24 '10 at 07:39
  • then perhaps you can p/invoke the function add font resource to install it if your program finds it missing. see http://www.pinvoke.net/default.aspx/gdi32.AddFontResource – Mitch Jan 24 '10 at 20:51
  • 3
    This is exactly why link only answers are bad things. – RubberDuck Aug 10 '15 at 12:30
  • @RubberDuck, you must be looking at the 4.5 page. Just select the [4.0 version](https://msdn.microsoft.com/en-us/library/ms753303(v=vs.100).aspx). The target page is quite long, and the summary is to "include the font in a resource file, and load it from there". – Mitch Aug 10 '15 at 14:04
  • 1
    Or you could add relevant information here in your answer and fix the links @Mitch. – RubberDuck Aug 10 '15 at 14:55
0

For anyone who stumbles on this in the future: There is a similar topic with more up-to-date and more detailed answers regarding this issue- Embedding/deploying custom font in .NET app

Community
  • 1
  • 1
Brady
  • 403
  • 1
  • 8
  • 19