Freigeben über


How to change default font in Windows Store Apps (C#, XAML)

By default, the font family in Windows Store Apps is set to Segoe UI. That means, if you use any control which has a font family property (ex: TextBlock, RichTextBlock, Button, etc. ) and if you do not set the value of this property explicitly, then Segoe UI will be it's default value.

To use other fonts, there is a very simple and usual way that you set the font family property of each and every control with any font you like.

But, what if you want a font across the application in all or almost all the controls that you have in your app. Then, its not a very good idea that you set the same font family to all the controls individually.

It will be better that you override the default font of the app (Segoe UI) with the font that you need.

Let me tell you how to do that...

The font family resource key name that points to the default font is - ContentControlThemeFontFamily.
To override the value of this resource, we will have to set the new value in App.xaml or in any resource dictionary that is declared in App.xaml.

Below is the code that shows how to set the default font in the app.

<FontFamily x:Key="ContentControlThemeFontFamily">YOUR NEW FONT NAME</FontFamily> 

 This new font will now be the default font of your app.