WPF Font Rendering Broken

47 Views Asked by At

I know this question has been asked previously but I've not seen a resolution and it's driving me nuts.

I have seen this issue across several fonts. Take for example the MetaPro font.

I have added the fonts otf files to MyApp under "Assets/Fonts"

e.g. MetaPro-Bold.otf, MetaPro-Normalemphasized text.otf

I have a Label:

<Label Content="800M2 APPROX" FontFamily="/MyApp;component/Assets/Fonts/#MetaPro" FontWeight="Bold" Foreground="#414042" Margin="0" Padding="0" HorizontalAlignment="Right"/>

This is how the font renders in Adobe Illustrator enter image description here

This is how the font renders in Blend/WPF/Xaml enter image description here

You can clearly see the numbers don't render the same as the letters and it looks nasty.

Why does WPF like to BORK fonts?

2

There are 2 best solutions below

0
zaphod-ii On

It seems to me that either Adobe Illustrator does some font substitution, or runs software enhancement over the font. I tested it (MetaPro Bold) in a font editor and it looks much closer to the rendered content of WPF. The '8' glyph stretches гихер up to the ascent line than the other number glyphs, which span in about 2/3 of (ascent - base). enter image description here

0
Ben On

I found the solution:

Typography.NumeralStyle="Lining"