October 30th, 2009

Legally using non-standard fonts in Silverlight and Blend

Silverlight Blend Tutorials, Working with Silverlight, by Gavin Wignall.

This post is part of a string of posts found here: Learn Blend in a Month.

Blend 3 allows you to embed fonts, but unfortunately if you publish your work online you are technically distributing the font. This is illegal and could potentially land you in trouble.

However, there is a way around this, if you encrypt the font so that it is not usable then you are arguably not distributing it any more. This process is known as Obfuscation. It is important, however, to point out that you still need a license or permission to use a non-standard font in your work.

How to Obfuscate a font

First open up Microsoft Word (2007+), create a new document and type every character you will need in the font you require. Save the file as an XPS document and close Microsoft Word.

Locate the saved XPS document on your hardrive and rename the file type from ‘.xps‘ to ‘.zip‘. Now extract the contents of the .zip and find the file called ‘Resources‘, inside this folder should be a document with the file type ‘.odttf‘. Add this file into your Silverlight Solution and set its ‘Build Action‘ to ‘Resource‘.

Now the final part, in the XAML, locate your textBlock and set the ‘FontFamily‘ property to the .odttf file in your solution. Directly after this needs to be a ‘#‘ and then the exact name of how the font was displayed in the selection field in Microsoft Word. This allows you to have multiple fonts in one .odttf file.

The XAML should look similar to the below.

<TextBlock x:Name="textBlock" FontFamily="./Fonts/20FD640A-6B8C-569B-6B08-6F60BA7CC534.odttf#Segoe UI" FontSize="12" Foreground="Black" Text="text content goes here" />

Back Top

Responses to “Legally using non-standard fonts in Silverlight and Blend”

  1. Greetings, Ilike your blog very much. It has niceinfo in it. I came here from search engine aol while was searching for fontssupply info. Keep working on blog I d place bookmark, thanks.

  2. Pixel Fonts for Silverlight and WPF at CodePlex.com

    http://pixelfonts.codeplex.com/

  1. Tweets that mention Legally using non-standard fonts in Silverlight and Blend » Silverlight Buzz -- Topsy.com (,October 31, 2009)

    [...] This post was mentioned on Twitter by Silverlight News, Saravanan I M. Saravanan I M said: RT @SilverlightNews: Legally using non-standard fonts in Silverlight and Blend – http://snurl.com/syncj [...]

  2. progg.ru (,October 31, 2009)

    Legally using non-standard fonts in Silverlight and Blend » Silverlight Buzz…

    Thank you for submitting this cool story – Trackback from progg.ru…

  3. uberVU - social comments (,November 2, 2009)

    Social comments and analytics for this post…

    This post was mentioned on Twitter by Silverlight News: Legally using non-standard fonts in Silverlight and Blend – http://snurl.com/syncj...

  4. Learn Blend in a Month (22 posts) from Silverlight Buzz « Vincent Leung .NET Tech Clips (,January 28, 2010)

    [...] Legally using non-standard fonts in Silverlight and Blend [...]

Leave a Reply

Back Top