Making an object re-usable as a User Control in Blend Optimizing Silverlight with Enable Redraw Regions
Oct 30

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" />

written by Gavin Wignall \\ tags: , , , , , , , , , ,

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

  1. Tweets that mention Legally using non-standard fonts in Silverlight and Blend » Silverlight Buzz -- Topsy.com Says:

    [...] 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 Says:

    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 Says:

    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…


Leave a Reply