#814 – You Can Specify a List of Fonts to Try

You normally indicate the font or typeface to use in rendering a control by specifying a value for the FontFamily property.

        <TextBlock Padding="20,10" FontSize="16"
                   FontFamily="Corbel">
            I drank what?  --Socrates
        </TextBlock>

814-001
However, you can also supply a list of fonts for the FontFamily property.  WPF will attempt to use the first font listed, but if the font is not installed on the target system, it will fall back to the next font in the list.  This fallback mechanism will continue, as WPF tries each font in the list.  If none of the fonts listed are found, WPF will use the default font, Segoe UI.

        <TextBlock Padding="20,10" FontSize="16"
                   FontFamily="Baskerville,Georgia">
            I drank what?  --Socrates
        </TextBlock>

814-002

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.

One Response to #814 – You Can Specify a List of Fonts to Try

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

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: