Directwrite is not always able to query font
See the question and my original answer on StackOverflowWhen you use FontBase and activate a font (file) it does two things
- it copies the file by default in a folder it owns (like
c:\users\simon\fontbase
). - it sets the registry like this in
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Fonts
:
Once that is done, you can see this font in the "old" Windows UI where the font is marked with a link/shortcut overlay:
But you can't see it in the newer Windows UI:
Some programs can use it, I guess because they manually read the registry setting and load the pointed font file directly.
But DirectWrite can't read it either, probably because it doesn't like the custom folder, this may be (I guess, can't find any official doc about this) a security thing as this relatively new feature Font Settings and Fonts in the Microsoft Store allows to install fonts directly from the app store.
So, to make it work you can configure FontBase to point to a folder below the %LOCALAPPDATA%\Microsoft\Windows\Font
s, like this:
PS: Note the folder can be a sub folder of the Fonts folder
Now once activated, DirectWrite will see it and the newer Windows UI too:
BTW, now that this feature exists, installing a font is pretty simple, you can also just change the registry and put the file in the Fonts folder by yourself, you don't need tools such as FontBase.
Otherwise, if you really want to use FontBase w/o reconfiguring it, you can also write a DirectWrite custom font file loader, read the registry and load the font "manually" (but DirectWrite won't enumerate it).