Installing a font on a client machine

馋奶兔 提交于 2020-01-14 08:42:09

问题


I'm using Visual Studio 2008 and the built-in installation tools for a C# client application. How can I use this installer to install a font on the client machine (if it's not already there)?


回答1:


In VS2005 (so I assume 2008 as well), right click on the File System on Target Machine, Add Special Folder -> Fonts Folder, then place your font file there.




回答2:


For me, Timothy Carter had the answer mostly right:

"right click on the File System on Target Machine, Add Special Folder -> Fonts Folder, then place your font file there."

But that was not enough. The Fonts didn't actually get installed as system Fonts.

To install the fonts, I had to visit the Properties for each font file and change Register=vsdrfDoNoRegister to Register=vsdrfFont. After that the Setup file I generated would also install the font!




回答3:


Take a look at this article.

http://www.atakala.com/Browser/Item.aspx?user_id=amos&dict_id=83

The most important call is the AddFontResource Win32 API call altough the described sequence of operations must be respected for you to have a working font setup in the system.

http://msdn.microsoft.com/en-us/library/ms534231(VS.85).aspx

The AddFontResource function adds the font resource from the specified file to the system font table. The font can subsequently be used for text output by any application.




回答4:


I'm using InnoSetup to deliver my VS applications. It allows you to install fonts from your system to the client system.

I never tested in Windows 7 or Vista (probably you'll have some permission issues).

Remember that not all the fonts are freely distributable.



来源:https://stackoverflow.com/questions/126594/installing-a-font-on-a-client-machine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!