Unable to set Font face in UWP sample

Manoj Kumar 21 Reputation points
2025-03-24T19:54:08.73+00:00

Hi Team,

I attempted to set the font face, but I was unable to do so. It happens to the font families that are already available on my machine. I tried to set the font family to 'Arial Black,' but it wasn't applied. While I could set the font to 'Arial,' I couldn't set it to 'Arial Black.' The fonts seem to apply, but the specific font face does not.

Example code:

<TextBlock x:Name="txtBlock" FontFamily="Arial Black" HorizontalAlignment="Center" Margin="10,10,0,0" TextWrapping="Wrap" Text="This is test Text Block"  VerticalAlignment="Center" FontSize="36"/>

Windows SDK: Windows10, version 10.0.19041
We have also tried to add the font family from the code behind but it also does not work

txtBlock.FontFamily= new FontFamily("Arial Black");

User's image

Expected Arial black output
User's image
I have attached a sample for replication.

Kindly let me know if you need more information.
https://drive.google.com/file/d/1fyG2zXTWLvqmoKS5aNQWDBslCYDBvP32/view?usp=drive_link

Developer technologies | XAML
Developer technologies | XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.