Embedding and Referencing Fonts in your WPF application

I found this is the easiest way to it. First of all you have to add desired font to your project. I usually create some sort of “Resources” folder in such cases.


It is very important to set properties of your newly added recourse as follows.


Build action must be set to “Content” and it must be copied to application working folder. You can set Copy always or Copy if newer either one will work.

This is how you can reference your font from XAML code.




Basically font file will be copied to build output directory and will be loaded dynamically by .NET runtime.

Microsoft provided other ways to do this. It’s possible to embed font as resource into application or some other referenced assembly. However I found this most useful.

Some other solutions to same topic:




About me

Bizic Bojan is Co-Founder of Amida IT-Services GmbH and Software Architect with focus on .NET, C++, Python and Cloud Native solutions. 



The opinions expressed herein are my own personal opinions and do not represent my employer’s view in any way.

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.