WPF application hangs when using fonts over 100pts in size

Symptom

You have a Microsoft .NET 3.5 Window Presentation Framework (WPF) application, which uses "large" characters and/or fonts. The application becomes unresponsive and hangs indefinitely.  

Cause

The Windows Presentation Framework UI thread has entered a critical section called the composition lock. While the UI thread is holding this lock, it need to synchronize communication with the Windows Presentation Framework render thread. The render thread is processing a large character when it needs to enter into the composition lock. Since the UI thread has the composition lock, the render thread waits for it and the threads become deadlocked.  

We have confirmed this is a bug in the Microsoft .NET 3.5 Framework.

Resolution

This bug has been fixed in Microsoft .NET 4.0 Framework. To work around this bug, avoid using large characters or fonts, or upgrade your application to target the Microsoft .NET 4.0 Framework.

More Information

In the above symptom, we define "large" to mean a character with an "effective" size of 100pt or greater, 100pt being the bug threshold. "Effective" refers to multiplying the font size by any transforms. The threshold takes into account any transformations that might be in effect, as well as the effect of your computer’s DPI setting. For example, if you use a 60-point Arial font within the scope of a RenderTransform that scales up by a factor of 2, the effective size is 120pt, which exceeds the 100pt threshold limit.  


內容

文章識別碼:2712383 - 最後檢閱時間:2012年6月18日 - 修訂: 1

意見反應