#817 – Embedding a Font into Your Application

When you specify fonts that are to be used with your application, you typically specify font attributes, like FontFamily, and then let Windows look for a previously installed font that matches what you’re asking for.

If you have a non-standard font that you want to use and you have a copy of the TrueType (.ttf) file for the font, you can embed the font in your application, to make sure that your font gets used at run-time.

To embed a font, do the following:

Copy the font (.ttf file) into your project directory.  Add the font to your project by right-clicking on the project and selecting Add Existing Item.


Set the filter to All Files, find and select the .ttf file, and click Add.



Set the Build Action for the font to Resource.


Finally, set the FontFamily property to the font’s name, prefixing the name with “./#”.




About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

One Response to #817 – Embedding a Font into Your Application

  1. Pingback: Dew Drop – May 10, 2013 (#1,545) | Alvin Ashcraft's Morning Dew

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: