This is a mirror of official site: http://jasper-net.blogspot.com/

Silverlight 5 Text Clarity and Pixel Snapping

| Sunday, September 4, 2011
One of the best improvements in WPF 4 was fixing the text clarity issue once and for all. It may seem trivial, but in a system that supports a vector-based scalable UI as well as animation of text elements, it's not quite as easy to solve it seems. Once we get PC displays with DPI similar to that we have on hand-held devices, snapped or unsnapped text will become a non-issue.

By necessity of its small download footprint and its cross-platform nature, Silverlight couldn't take the same approach used by WPF (which is tied 100% to Windows). However, the team has added a more portable implementation of the code which helps improve text clarity and is API-compatible with WPF.

    Test your text rendering on the mac. This is one area where Silverlight differs significantly between the two platforms. That's due to ClearType being a Microsoft technology, and Mac users generally not wanting pixel-snapped text.

On Windows, Silverlight defaults to ClearType unless you specifically disable it through the TextOptions. On the Mac, ClearType is not available and grayscale rendering is the only text rendering option.

In the examples below, I set the options on each TextBlock individually. However, in a real application, you'll typically set the option at the root UserControl / Page and let the option flow through to the rest of the elements on the page.


Read more: 10Rem.Net
QR: silverlight-5-text-clarity-and-pixel-snapping

Posted via email from Jasper-net

0 comments: