One of the things that I’ve wanted to do since Silverlight released was two things with text, enable a Stroke and layout text on a Path. Both of which in Silverlight 2 aren’t readily available. Luckily we have a great ecosystem of developers and MVPs who love to extend our frameworks and create new capabilities for developers.
Bill Reiss has done just that. You may recognize Bill from some XNA and Silverlight gaming fame. His game of Dr. Popper still remains my daughter’s favorite computer game! Bill has created a new Silverlight user control he calls PathTextBlock control. Bill describes the new control:
“The PathTextBlock control converts text to a Path which allows you to do a couple of things you can't normally do with text in Silverlight. First of all, instead of a Foreground brush, you have a Stroke and a Fill, which allows you to draw text with an outline. Secondly, the PathTextBlock supports Transform objects which can allow you to distort the text, draw it along a curve, or other transforms. You can easily create your own transforms as well.”
This basically allows you to have a normal TextBlock, but distort and outline it…here’s an example output:
Bill has also included a few transforms to play around with as well. All of this is included in an Ms-Pl licensed component that is available on Codeplex. Go check out Bill’s blog post for a link and description.
Please enjoy some of these other recent posts...