-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Fonts
In versions prior to 3.0.0 the only way to reference the bundled Roboto font was as a packed resource using:
FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"
With version 3.0.0 this has been greatly simplified using the new MaterialDesignFont
markup extension. Now you can simply reference the font using:
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
[...]
FontFamily="{materialDesign:MaterialDesignFont}"
If you would prefer to have the Roboto font files included in your project rather than just as embedded resources inside of the material design library you can add a new property to your project.
First edit your csproj file and add the following inside of the <Project>
element.
<PropertyGroup>
<IncludeMaterialDesignFont>True</IncludeMaterialDesignFont>
<MaterialDesignFontDirectory>Resources\Roboto\</MaterialDesignFontDirectory>
</PropertyGroup>
Then rebuild your project. In your output directory, you will see the font font show up under a Resources\Roboto directory. Depending on which version of the csproj you are using, you may also see the files show up in the folder inside of your solution explorer.
More details and discussion on this can be found in Issue 746
If you see any mistake or want to contribute to this wiki feel free.
Home
Contributing
Compiling From Source
Glossary
Getting Started with MDIX
Getting Started
Tutorial On YouTube (português-BR)
Frequently Asked Questions
Examples Repository
Release Notes
Pack Icon Changes
2.0.0 Breaking Changes
Controls
All Control Styles
Buttons
ComboBox
Dialogs
PopupBox
Snackbar
TextBox
Toggle Button
Transitions
Icons
Theming
Advanced Theming
Brush Names
Custom Palette Hues
Fonts
Overriding Material Design Styles
Swatches and Recommended Colors
Miscellaneous
MahApps Integration
Performance
Strong Naming
.NET 4.0 Compatibility
Projects using Material Design
Understanding Routed Commands