#814 – You Can Specify a List of Fonts to Try
May 7, 2013 1 Comment
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>
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>