views:

74

answers:

2

Is there a way to render pixel fonts correctly in Silverlight 4? Without breaking text into paths or some sort of manual rendering because the text is dependent on data binding. Tweaks with UseLayoutRounding and .5px positioning shifting don't work. alt text

+2  A: 

MS render the font anti-aliased to make them look better... generally... but of course that does not work for pixel fonts that are already optimised for a specific display size.

Manual rendering from a set of pngs would be your best bet (until MS add a new rendering option).

You would of course have to write your own font manager and create/subclass a user control to replace the TextBlock (so that your binding methods still work). I have not found an existing pixel font manager (yet).

Good luck with your project.

Enough already
Initially I was going to override OnRender to draw text manually but then suddenly realized that there are no such method in Silverlight 4 :( http://dotnet.uservoice.com/forums/4325-silverlight-feature-suggestions/suggestions/1015921-add-low-level-drawing-apis
Koistya Navin
+3  A: 

Just have created a custom TextBlock control which renders text with a pixel font and anti-aliasing turned off.

Pixel Fonts for Silverlight

Koistya Navin
+1 for extreme coolness in the face of adversity :)
Enough already
Enough already
Thanks :) Nice to hear that
Koistya Navin