0

I am using the font "Code Bold" for a WPF application, font is embedded and looks to be working in Expression Blend and the WPF designer.

As shown here:

The bottom text looks to be better antialised. What could be a problem here (except that the font sizes don't match).

I already added these tags to the control and parent window:

    TextOptions.TextFormattingMode="Display"
    TextOptions.TextRenderingMode="ClearType"

Does it have to do that the font is not Cleartype?

Roger Far
  • 2,178
  • 3
  • 36
  • 67

2 Answers2

0

Try playing with SnapsToDevicePixels or UseLayoutRounding (depending on version of WPF) on yourelements that use the text, between all of these settings you should get what you need.

Dean Chalk
  • 20,076
  • 6
  • 59
  • 90
  • Thanks will do that. This textbox is in a border control, but I read somewhere that you can better but a rectangle behind it, I will check that too. – Roger Far Apr 25 '12 at 11:53
0

UseLayoutRounding="True" worked for me. I'm using: WPF .NET 4.5.

I also tried SnapsToDevicePixels="True" and RenderOptions.ClearTypeHint="Enabled" but these made no difference.

In my case I am creating custom controls. I set UseLayoutRounding in the style sheet of the custom control. All control instances are now rendering text correctly.

JSON C11
  • 11,272
  • 7
  • 78
  • 65