如何在 C# 中获取重复字体及其类型(Type 1、TrueType 等)的列表?
我正在尝试在 Windows 2008 计算机上查找重复的字体。棘手的部分是当您查看 C:\Windows\Fonts 时,重复的字体可能会以不同的名称显示。直到您双击它们并查看属性时,字体名称才相同。我们遇到字体冲突的问题,因为我们同时安装了 TrueType 和 Type 1。
我已经尝试过以下操作:
InstalledFontCollection collection = new InstalledFontCollection();
foreach (var family in collection.Families)
{
Console.WriteLine(family.Name);
}
但是,这只给出了字体系列名称,并且不显示单独安装的字体文件。我找不到从 InstalledFontCollection 或 FontFamily 中的字体列表获取字体类型的方法。
I'm trying to find duplicate fonts on a Windows 2008 machine. The tricky part is when you look in C:\Windows\Fonts that duplicate fonts may show up with different names. It is not until you double click on them and see the properties that the Typeface name is the same. We're having problems with fonts conflicting because we have a TrueType and a Type 1 installed at the same time.
I've tried the following:
InstalledFontCollection collection = new InstalledFontCollection();
foreach (var family in collection.Families)
{
Console.WriteLine(family.Name);
}
But, that only gives the font family names and does not show individually installed font files. I couldn't find a way to get the font type from the InstalledFontCollection or a list of the fonts in the FontFamily.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论