Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF 4.0 Font Rendering Issue

Tags:

wpf

fonts

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 3.5

.net 4.0: .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:

Blend

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?

like image 443
CatBusStop Avatar asked Apr 19 '10 10:04

CatBusStop


2 Answers

"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.

like image 190
Henk Holterman Avatar answered Nov 15 '22 08:11

Henk Holterman


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.

like image 21
Markus Hütter Avatar answered Nov 15 '22 08:11

Markus Hütter