#822 – Deciding which TextFormattingMode to Use

The TextOptions.TextFormattingMode property indicates whether fonts should be formatted using the standard WPF algorithm or the legacy GDI method for positioning the individual glyphs in the font.  The property can have one of the following values:

  • Ideal – Default value, formats text using the standard WPF method.  Glyph shapes are preserved, independent of their final position on the display
  • Display – Positions edges of glyphs on pixel boundaries.  Can result in clearer edges of text.

You should use the value of Ideal, except for the situations listed below.

Set TextFormattingMode to Display when all of the following is true:

  • The FontSize of the text is 14 or less  (small text)
  • Text is not being transformed (scaled, rotated, translated)
  • The exact shape of the glyphs is not critical (e.g. for some graphic design scenario)

About Sean
Software developer in the Twin Cities area, passionate about .NET technologies. Equally passionate about my own personal projects related to family history and preservation of family stories and photos.

2 Responses to #822 – Deciding which TextFormattingMode to Use

  1. Pingback: Dew Drop – May 17, 2013 (#1,549) | Alvin Ashcraft's Morning Dew

  2. Pingback: Interesting .NET Links - May 24 , 2013 | TechBlog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: