且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在SharpDX中使用文件中的字体?

更新时间:2023-02-21 09:48:39

不幸的是,遗憾的是,DirectWrite 中没有 API 可以轻松支持这一点.您需要开发自己的字体加载器和相关类.有 SharpDX 示例 CustomFont 正在从资源,因此您可以调整它以从其他位置加载.

Unfortunately, afaik, there is no API in DirectWrite that supports this easily. You need to develop your own font loader and related classes. There is the SharpDX sample CustomFont that is loading fonts from resources, so you could adapt it to load from another location.