Reputation: 10067
I want to find all paths that contain font files that are installed on a Windows 10 system. Traditionally, fonts are installed in C:\Windows\Fonts
but apparently, they can also be installed in different directories.
Specifically, I got a report from a user who has installed the font Albertus Extra Bold
on Windows 10. When he opens C:\Windows\Fonts
in Explorer, selects Albertus Extra Bold
and chooses "Properties" from the context menu, the dialog shows that the *.ttf file of the font apparently is not installed in C:\Windows\Fonts
but in C:\Users\Admin\AppData\Local\Microsoft\Windows\Fonts
.
So should my app simply scan %USERPROFILE%\AppData\Local\Microsoft\Windows\Fonts
on top of C:\Windows\Fonts
or can there be more paths that can contain fonts on Windows 10?
Upvotes: 3
Views: 14239
Reputation: 514
There are 3 types of fonts:
%windir%\Fonts
.%USERPROFILE%\AppData\Local\Microsoft\Windows\Fonts
. It only exists since the build 10.0.17083 (Source)If you are looking for a way to know all the font filename that you have currently, you need to use DirectWrite
If you are looking to an implementation, you can see how the python library FindSystemFontsFilename did it.
Upvotes: 2
Reputation: 10067
Ok, I figured it out: It seems to be a Windows 10 thing. When I double-click a *.ttf file on my Windows 7 system and click on "Install", the font will be installed in C:\Windows\Fonts
. On Windows 10, however, doing the same will lead to the font being installed in %USERPROFILE%\AppData\Local\Microsoft\Windows\Fonts
. So it seems Windows 10 uses non-system folders to avoid requesting admin privileges from the user.
Upvotes: 4