willvv
willvv

Reputation: 8649

Get fontfile from a given font name

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 font 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

Upvotes: 3

Views: 2061

Answers (1)

user269280
user269280

Reputation:

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

Upvotes: 6

Related Questions