Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

blurry font in silverlight2 app

I did my first Silverlight 2 application and what annoys be is that text-fonts looks blurry or ragged.

You can see it here:

alt text http://img516.imageshack.us/img516/1444/blurryfonthp3.png

Is that a 'feature' of SL or I'm doing something wrong?

I know that SL2 uses a few fancy techniques to make applications device-independed but this fonts aren't acceptable (i'm using Vista with Aero ).

The bonus question: is there any reference business application in SL2?

Best regards,

Tomasz

like image 263
tomo Avatar asked Jan 26 '09 09:01

tomo


2 Answers

I would definitely say it looks blurry - kind of like as if you were viewing this on OSX or Linux. I too agree that this is unacceptable - together with WPF, of course, where font rendering is awful as well. Now, while Microsoft keeps on promising to fix this for .NET 4 release, fact is, many of us need to ship/sell stuff today, which leads to the following choices:

  • You can ignore common sense and just ship the software as is - making fonts bigger and what have you. So long as your customer buys, what's the problem? (not my choice, though)
  • If you are working with Silverlight, you can wait until some future release until this is fixed (same for WPF). Good luck. Look at how long WPF has been around, everyone knew about this problem and, guess what - it hasn't been fixed.
  • If you are working with WPF, you can get the perfect font rendering - an algorithm that is even marginally better than what Vista does (which, let's face it, is near-perfect). Same goes for WinForms. The algorithm for an ideal ClearType is a mixture of judicious use of subpixel rendering, antialiasing and using font hinting (where available). I have done this, and have even had fun optimizing it for SIMD and the like. It is a serious investment of your time, though.
  • Pixel fonts. I haven't tried this myself, but it should work.
  • Pre-rendered bitmaps. Oh yeah, if you want to kill the speed, go ahead. Having said that, I think it's acceptable provided you know you're taking advantage of hardware acceleration.

I guess what I'm trying to say is this: there is a solution for WPF/WinForms (yes, WinForms ClearTypeGridFit isn't the best algorithm either), but there isn't a solution for Silverlight. Yet. I wish someone would prove me wrong.

like image 195
Dmitri Nesteruk Avatar answered Oct 03 '22 11:10

Dmitri Nesteruk


The anti-aliasing is just a feature of Silverlight; wouldn't say it looks blurry though, I quite like it.

Reference wise, I don't think there's a fully blown app sample I've seen, but if you look into Model-View-ViewModel with IPropertyNotifyChanged / ObservableCollection and have a browse through the blogs of Jesse Liberty and Shawn Wildermuth they have plenty of information on data transfer and multiple page applications - both of which you'll need to do a "business app"

like image 33
Steven Robbins Avatar answered Oct 03 '22 11:10

Steven Robbins