In this article, a discussion of the new text improvements in Silverlight 5 including: Text Tracking and Leading, Linked and Multi-column Text, OpenType Support, Pixel Snapped Text and TextOptions. Please review the Roadmap for the series before going any further.
The Roadmap for this Series
Included, the Roadmap for the series below as you may want to visit other sections as you learn Silverlight 5. I picked the following features as I thought that you may find them useful in your day-to-day work. If you want a specific topic covered then please leave it in the comments below.
- Introduction to SL5 – provides a brief history of Silverlight and relevant links.
- Binding – Ancestor Relative Source Binding and Implicit Data Templates.
- Graphics – XNA 3D API and Improved Graphics Stack.
- Media – Low-Latency Sound using XNA and Remote Control and Media Command (Keys) Support.
- Text [This Post] – Text Tracking and Leading, Linked and Multi-column Text, OpenType Support, Pixel Snapped Text and TextOptions.
- Operating System Integration Part 1 – P/Invoke, Multiple Windows and Unrestricted File System Access in Full Trust.
- Operating System Integration Part 2 – Default Filename for SaveFileDialog, 64-bit browser support and Power Awareness.
- Productivity and Performance – XAML Binding Debugging, Parser Performance Improvements and Multi-core JIT for improved start-up time.
- Controls – Double and Triple click support, PivotViewer and ComboBox Type-Ahead.
- Other items – In-Browser HTML, PostScript and Tasks for TPL.
Linked and Multi-Column Text
We will use an example that I’ve demonstrated in the past that many have found helpful. The Linked and Multi-Column Text feature enables the text of a RichTextBlock control to overflow from one into the next. Multiple RichTextBlockOverflows can be chained together to spread text across a layout. Let’s go ahead and take a look at a screenshot of a RichTextBlock with a RichTextBlockOverflow working together.
As you can see from this screenshot, we had a RichTextBlock in the upper left and its content overflowed onto the RichTextBlockOverFlow #1, #2 and #3. You can think of this as something that is similar to a newspaper article. As the browser expands or contracts the content fills the available area.
Let’s check out the code that made it happen: