'Windows fonts not immediately useable in application after installing?
Whenever I install a new font on a Windows 2003 server, I can't use it immediately in my asp.net web application. The application gets the font through the CreateFontIndirect gdi32.dll win api, and then use this font to create a dynamic text image in my asp.net application. It seems like fonts get cached somewhere, because I will just get the default font returned.
The font cache gets updated after a reboot, and then I get the correct font, but obviously I wouldn't like to do a reboot on a production server just for getting a new font to work.
Is there a way to flush the font cache?
Solution 1:[1]
Restart IIS. that should do the trick. rub iisreset from command line or use IIS manager.
Solution 2:[2]
I recycle the application pool that use the fonts and it fixed.
Solution 3:[3]
When installing fonts on a server, NEVER double click them to install, otherwise it only installs for the current user. Instead you should right click the font file and select "Install for all users". The font will then be available right away for use in your web application.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source | 
|---|---|
| Solution 1 | user1923248 | 
| Solution 2 | Mahdi Jannati | 
| Solution 3 | Randall | 
