Get font from given font name

I am trying to get a file that matches this system font, for example: On my system, I have the font "Algeria" with the corresponding file "C: \ Windows \ Fonts \ ALGER.TTF", and the font Batang, with the file "C: \ Windows \ Fonts \ batang.ttc ".

I saw a couple of messages saying that I can do this, iterating the font folder and extracting the font name from the file header (as described here: http://www.codeguru.com/cpp/gm/gdi/fonthandlinganddetection/article. php / c3659 / ), but it seems inefficient and a bit complicated.

Is there a better way to do this? or do I need to iterate over the entire directory?

thank

+3
source share
1 answer

In HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ Fonts you got a list of fonts with your file name

+6
source

Source: https://habr.com/ru/post/1731980/


All Articles