How do I use a custom font in my WPF application?

Windows ships with a number of attractive fonts pre-installed, however there are many other beautiful and distinctive fonts that are not. Rather than limit your UI design to only the default fonts, WPF makes it easy to distribute custom fonts with your application. I saw this technique on Filipe Fortes' Mix06 video, and subsequently learned he's created a screen-cast showing how to add and use custom fonts. Here's a summary:

Including the Font in your Application
Include the font in your application adding it to your visual studio project. The Build Action should default to 'Resource'. You may wish to create a folder to separate custom fonts, images and other visual resources from your Xaml and C# code. For the purposes of this example we're going to assume you created a folder called CustomFonts and added a font called Pericles (which ships with the WPF SDK in a file called peric.ttf) to that folder.

Using the Font in your Application
You can use the custom font by setting the FontFamily property of elements like TextBlock to the font resource. The path to the font resource should include the names of the folder(s) and sub-folders in your project you placed the font in (separated by the / character), followed by a # and the name of the font (which is not necessarily the same name as the file it is in). For example the following code uses the Pericles font in a TextBlock

Xaml Code (Feb 2006 CTP)
<TextBlock FontFamily="CustomFonts/#Pericles" FontSize="20">WPF makes text beautiful</TextBlock>

Fonts are intellectual property (like programs, songs and movies) so ensure you check the license for the fonts you intend to redistribute. For a varied list of free fonts you could start here http://fontleech.com/ .