问题
I have been stuck on this for quite some time. I have searched and found how to publish apps using the windows installer and the oneclick but this does not solve my problem. I created a very simple C# Windows app that takes the user's input and converts it to a different language. The language is letter-by-letter so there is no difficult pronunciation or structure that has to be taken into account. The program simply takes the input in a Times New Roman font and outputs it in the special font for the other language. It works great. Until I take it to another computer and install it only to find that the fonts are not there. My question is how do you add the font files to the installer for the target system to use? Is this possible?
回答1:
If the true reason is that the font doesn't exist on the target machine, you can add a custom folder to your setup project called the Fonts Folder
. There you can place any font dependencies you want deployed with your project.
回答2:
You could include the font files, and an .ini file, with the installation and then use Microsoft's 'fontinst.exe' program to install them.
http://blog.stevienova.com/2007/09/28/installing-fonts-programmatically-on-windows/
http://www.google.com/search?q=installing+fonts+programmatically
回答3:
Another option is to use a custom installer. I use InnoSetup for my applications, which I think is easy to work with.
There is a mechanism there for installing fonts. Here's an example
来源:https://stackoverflow.com/questions/7353758/how-do-you-publish-a-c-sharp-windows-app-with-font-files-correctly