Search code examples
c++windowsfontsfreetype

Get a font filepath from name and style in C++/Windows


I'm currently implementing FreeType 2 in a project of mine and thus need the filepaths for Fonts on my system. I need a solution that only takes the fonts name and the desired font style (eg. bold or italic) and then returns the filepath for the font.

I already tried the answer from this Stack Overflow question, but it doesn't work on Windows 7 (and probably neither on Vista), but obviously I need a solution that works on these systems and future systems as well.


Solution

  • May I ask why do you need the path to a physical file?