Click here to Skip to main content
13,903,802 members
Click here to Skip to main content
Add your own
alternative version


2 bookmarked
Posted 22 Oct 2009
Licenced CPOL

Much Improved .NET 4.0 WPF Text Rendering

, 22 Oct 2009
Rate this:
Please Sign up or sign in to vote.
Much improved .NET 4.0 WPF text rendering

In .NET 4.0, WPF text rendering has been greatly improved.

However, this new feature is not enabled by default.

You can read the complete feature write up on the WPF Text Blog.

The scenario where you get the most payback for using this feature is with text that is sized 15pt and below.

Line of Business forms containing TextBlocks, Labels, CheckBoxes, RadioButtons, Buttons and TextBoxes will have FontSizes below 15pt and will receive the most benefit of this new feature.

The feature is enabled by placing the “TextOptions.TextFormattingMode” attached property on the UI Element or on a parent UI Element.

<TextBlock Text=".NET 3.5 rendering" />
<TextBlock Text=".NET 4.0 improved rendering" TextOptions.TextFormattingMode="Display" />

The below XAML demonstrates how to have all text rendering use the new text rendering feature by placing the “TextOptions.TextFormattingMode” attached property on the Window.

In the below example, all child controls of the Window will use the new text rendering.

<Window x:Class="MainWindow"



    Title="MainWindow" Height="350" Width="525"


        <TextBlock Text="Inherited the .NET 4.0 improved rendering" />


Visual Studio 2010 Beta2 and .NET 4.0 have a lot of new goodness, go check it out!

Have a great day.

Just a grain of sand on the world's beaches.

Posted in Cider Designer, CodeProject, VB.NET, Visual Studio 2010, WPF General


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Karl Shifflett
Architect Self
United States United States

I’m a passionate Platform Architect at Infragistics.

I’m a long-time WPF-Prism fanatic who enjoys writing developer tools and line of business applications.

My front end passions are WPF, Electron, ES2015 (ES6), Node.js, and Angular.

For the back end I use what is appropriate for the project: SQL Server and ASP.NET WebAPI, MongoDB, Express, Azure, Firebase, etc.

I am very pragmatic software engineer and strive to write simple, maintainable, and testable code. Simple code allows for solving complex problems in a maintainable way.

My Blog

My Github Repros

Just a grain of sand on the worlds beaches.

You may also be interested in...

Comments and Discussions

QuestionShouldn't this be activated by default? Pin
fabrice.marguerie27-Oct-09 12:31
memberfabrice.marguerie27-Oct-09 12:31 
AnswerRe: Shouldn't this be activated by default? Pin
Karl Shifflett27-Oct-09 21:08
memberKarl Shifflett27-Oct-09 21:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web01 | 2.8.190306.1 | Last Updated 23 Oct 2009
Article Copyright 2009 by Karl Shifflett
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid