title: How to set FontFamily in code
body: <p>I'm creating a WPF application where I need to use custom fonts. A created a font resource library as described here <a href="http://msdn.microsoft.com/en-us/library/ms753303.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms753303.aspx</a>. An example shows how to set a font family in XAML:</p>
  
  <pre><code>&lt;Run FontFamily="/FontLibrary;Component/#Kootenay" FontSize="36"&gt;
    ABCDEFGHIJKLMNOPQRSTUVWXYZ
  &lt;/Run&gt;
  </code></pre>
  
  <p>How do I set a font family in the code?</p>