Skip to Content
Introducing .NET 4.0: with Visual Studio 2010
book

Introducing .NET 4.0: with Visual Studio 2010

by Alex Mackey
February 2010
Beginner content levelBeginner
400 pages
11h 13m
English
Apress
Content preview from Introducing .NET 4.0: with Visual Studio 2010

15.6. Text-Rendering Improvements

In previous releases of WPF, text could sometimes appear a bit blurry. This is fixed in WPF 4.0 (possibly driven by the need for clear text in the VS2010 IDE), and you now have much finer-grained control over how text is rendered with the new TextFormattingMode and TextRenderingMode properties.

15.6.1. TextOptions.TextFormattingMode

TextFormatting mode allows you to set the text metrics that WPF will use for formatting text. TextFormatting mode has two settings:

  • Ideal (as per previous versions)

  • Display (ensures that every glyph's position and width is not fractional, which is very similar to how the GDI renders text)

The following code demonstrates setting text to use the Display setting:

<TextBlock TextOptions.TextFormattingMode="Display"> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET 3.5 For Dummies®

ASP.NET 3.5 For Dummies®

Ken Cox
ASP.NET 4 Unleashed

ASP.NET 4 Unleashed

Stephen Walther, Kevin Hoffman, Nate Dudek

Publisher Resources

ISBN: 9781430224556Purchase book