-
Register system font
Hello, all.
I need to register system font using C++, but I do no know how to register it without restarting my computer. That is what I do:
1. Copy font file (fontfilename.otf) to C:\WINDOWS\Fonts\
2. Add key to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts, fontname REG_SZ fontfilename.otf
It works but after restarting my computer.
I know that it's possible using WinAPI, but I do not know the way. Any ideas?
Best Regards
Alexander Olekhnovich
-
Re: Register system font
Call AddFontResource or AddFontResourceEx and maybe before that CreateScalableFontResource.