WPF application freezes when rendering text (wpfgfx issues) WPF application freezes when rendering text (wpfgfx issues) windows windows

WPF application freezes when rendering text (wpfgfx issues)


The connection is: Windows Presentation Foundation Font Cache service.

Sources:

WPF uses a Font-Cache service, running as a separate process, for, well, caching fonts. Whenever your WPF app needs to draw some text, it might ask the cache service for fonts. Once in a while the font cache might get corrupted and it then will/may randomly impact any WPF application.

Unfortunatelly, restarting the service is not enough. When this happens, you must delete all FontCache files that this service keeps on the disk. Before deleting them, you must stop the "Windows Presentation Foundation Font Cache service (or whatever it's called in your languge, for example Usługa buforowania czcionek platformy Windows Presentation Foundation in Polish..). Then, go to

  • Win7: %systemdrive%\Windows\ServiceProfiles\LocalService\AppData\Local\
  • Vista: %systemdrive%\Windows\ServiceProfiles\LocalService\AppData\Local\
  • WinXP: %systemdrive%\Documents and Settings\LocalService\Local Settings\Application Data

and remove all files looking like FontCache.dat. The source articles mentioned only one file (FontCache3.0.0.0.dat, but in my case there were around 8 files with similar naming convention).

After deleing them and restarting the service, all versions of my application were running properly again. No black screens, no freezing on textbox.