WPF - Add Custom Font

You may want to check the name of the font, you need to specify the name of the font not the name of the file.

Double click on the font file and it should show a "Font name:" that's what you want to make sure is specified in your style.


Try this

<Window.Resources>
    <Style x:Key="Gotham-XLight">
        <Setter Property="TextElement.FontFamily" Value="CustomFonts/#Gotham-XLight" />
    </Style>
</Window.Resources>

Also, if you are not planning on changing the style at runtime {StaticResource Gotham-XLight} will be much more performant.