从文件加载字体在C#应用程序应用程序、加载、字体、文件

由网友(闭关i)分享简介:我想加载和使用的字体在C#中的桌面应用程序。这是可能的,而不在系统上安装的字体?I wish to load and use a font to a desktop application in C#. It's that possible without installing the font on the sys...

我想加载和使用的字体在C#中的桌面应用程序。这是可能的,而不在系统上安装的字体?

I wish to load and use a font to a desktop application in C#. It's that possible without installing the font on the system?

这是一个各种问题如这但不能从DLL。我想从字体文件加载。

It's a kind of question like this but not from a DLL. I want to load from font file.

推荐答案

有一类System.Drawing.Text.PrivateFontCollection在System.Drawing.dll程序,可以针对每个应用程序的基础管理字体。

There's a class System.Drawing.Text.PrivateFontCollection in System.Drawing.dll which can manage fonts on a per application basis.

你要做的就是您在应用程序内维持此集合,你通过AddFontFile或AddMemoryFont添加字体,然后你就可以使用该字体,如果它被安装在系统上。

All you do is that you maintain this collection within your app and you add fonts through AddFontFile or AddMemoryFont and you'll then be able to use that font as if it was installed on your system.

这就像安装的字体仅用于申请。一旦这个过程结束的字体将被卸载。

It's like installing the font for the application only. The font will be uninstalled once the process terminates.

阅读全文

相关推荐

最新文章