开发者

Get fontfile from a given font name

开发者 https://www.devze.com 2022-12-19 09:35 出处:网络
I\'m trying to get the file corresponding to a given system font, e.g: In my system I have the font \"Algerian\" with the corresponding file \"C:\\Windows\\Fonts\\ALGER.TTF\", and the fo开发者_C百科nt

I'm trying to get the file corresponding to a given system font, e.g: In my system I have the font "Algerian" with the corresponding file "C:\Windows\Fonts\ALGER.TTF", and the fo开发者_C百科nt Batang, with the file "C:\Windows\Fonts\batang.ttc".

I've seen a couple of posts saying that I can do this by iterating the fonts folder and extracting the font name from the file header (as explained here: http://www.codeguru.com/cpp/g-m/gdi/fonthandlinganddetection/article.php/c3659/), but this seems inefficient and a bit complicated.

Is there a better way to do it? or do I have to iterate the whole directory?

Thanks


In HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts you got the list of font with their filename

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号