Adding font in wpf application
For using a font in resource
- Add font ton project and set it as resource (for sample https://www.1001fonts.com/saligra-font.html)
- Use it in xaml as
FontFamily="./#Saligra"
without extension - Set Resource as Build Action for
Saligra.ttf
sample
1 2 3 |
<TextBlock Text="SAMPLE" DockPanel.Dock="Top" FontFamily="./#Saligra" /> |
see : https://wpf.2000things.com/tag/embedding-fonts/
If font is not install in your computer you cannot show then in editor ate first time, only in running
Categories: Non classé
Commentaires récents