WPF 4.0 Font Rendering Issue

妖精的绣舞 提交于 2020-01-14 08:00:15

问题


I'm getting a weird rendering issue with WPF 4 applications in the way they render some of the text as it's stretching it and making it very narrow.

.net 3.5:

.net 4.0:

At first I thought it could be a problem with the font, but I'm also seeing the same problem in the Blend 4 beta:

I'm running XP SP3, Visual Studio 2010 Professional and everything's as up to date as it can be. I'm not noticing any such problems with Silverlight 4 apps I have built on the same machine... Anyone else seen this or know why it's happening?


回答1:


"Know why this is happening?"

The text stack now supports display-optimized character layout, also see this page

It should be configurable but I can't find details right now.




回答2:


I believe this was a Problem with certain fonts not being installed.

Check for SegoeUI!

They are located in %ProgramFiles%\Microsoft Expression\Common\Fonts

to answer your question about why this is happening: I think it was because i uninstalled some previous version of either blend or visual studio which also removed the fonts.

I fired up Snoop on Blend and noticed the path the font was referencing. It was the right path but somehow blend still couldn't find the Font (I guessed it then took the alphabetically following font). So I installed it to Windows' Fonts Folder and all was fine.

I had this issue a while ago so bear with me if I don't recall it all right.




回答3:


Try disabling hardware acceleration: http://msdn.microsoft.com/en-us/library/aa970912.aspx



来源:https://stackoverflow.com/questions/2666490/wpf-4-0-font-rendering-issue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!