如何获得一个字体文件名? [英] How to get a font file name?

查看:152
本文介绍了如何获得一个字体文件名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经写了这段代码:

  List< string> fontNames = new List< string>(); 
foreach(FontFamily.Families中的FontFamily字体)
{
fontNames.Add(font.Name);
}

来获取字体名称,但是可以说如果要将字体复制到另一个文件夹,如何得到字体的文件名,以便做复制操作?



谢谢。

\\字体',基本上每个字体文件被放置在C:\ Windows \ Fonts,除非在别处提到。


I've written this code:

List<string> fontNames = new List<string>();
foreach (FontFamily font in FontFamily.Families)
{
    fontNames.Add(font.Name);
}

to get fonts name, but lets say if you want to copy the font to another folder, how would I get the font's file name in order to do the copy operation?

Thank you.

解决方案

If you're able to access the registry, so you could get the file name out of the Key: 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts', basically every font file is placed in C:\Windows\Fonts, unless mentioned elsewhere.

这篇关于如何获得一个字体文件名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆