Skip to main content
.NET Framework Class Library
FontStyle Structure

Defines a structure that represents the style of a font face as normal, italic, or oblique.

Namespace:   System.Windows
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Syntax
<[%$TOPIC/ms602615_en-us_VS_110_1_0_0_0_0%](GetType([%$TOPIC/ms602615_en-us_VS_110_1_0_0_0_1%]))> _
<[%$TOPIC/ms602615_en-us_VS_110_1_0_0_0_2%]([%$TOPIC/ms602615_en-us_VS_110_1_0_0_0_3%].None)> _
Public Structure FontStyle _
	Implements [%$TOPIC/ms602615_en-us_VS_110_1_0_0_0_4%]
[[%$TOPIC/ms602615_en-us_VS_110_1_0_1_0_0%](typeof([%$TOPIC/ms602615_en-us_VS_110_1_0_1_0_1%]))]
[[%$TOPIC/ms602615_en-us_VS_110_1_0_1_0_2%]([%$TOPIC/ms602615_en-us_VS_110_1_0_1_0_3%].None)]
public struct FontStyle : [%$TOPIC/ms602615_en-us_VS_110_1_0_1_0_4%]
[[%$TOPIC/ms602615_en-us_VS_110_1_0_2_0_0%](typeof([%$TOPIC/ms602615_en-us_VS_110_1_0_2_0_1%]))]
[[%$TOPIC/ms602615_en-us_VS_110_1_0_2_0_2%]([%$TOPIC/ms602615_en-us_VS_110_1_0_2_0_3%]::None)]
public value class FontStyle : [%$TOPIC/ms602615_en-us_VS_110_1_0_2_0_4%]
[<[%$TOPIC/ms602615_en-us_VS_110_1_0_3_0_0%]>]
[<[%$TOPIC/ms602615_en-us_VS_110_1_0_3_0_1%](typeof([%$TOPIC/ms602615_en-us_VS_110_1_0_3_0_2%]))>]
[<[%$TOPIC/ms602615_en-us_VS_110_1_0_3_0_3%]([%$TOPIC/ms602615_en-us_VS_110_1_0_3_0_4%].None)>]
type FontStyle =  
    struct 
        interface [%$TOPIC/ms602615_en-us_VS_110_1_0_3_0_5%] 
    end
JScript supports the use of structures, but not the declaration of new ones.
<object fontStyleProperty="fontStylesValue"/>

XAML Values

fontStylesValue

A FontStyles value, such as "Normal", "Italic", or "Oblique".

The FontStyle type exposes the following members.

Methods
  NameDescription
Public method Equals(FontStyle)Compares a FontStyle with the current FontStyle instance for equality.
Public method Equals(Object)Compares an Object with the current FontStyle instance for equality. (Overrides ValueTypeEquals(Object).)
Public method GetHashCodeRetrieves the hash code for this object. (Overrides ValueTypeGetHashCode.)
Public method GetTypeGets the Type of the current instance. (Inherited from Object.)
Public method ToStringCreates a String that represents the current FontStyle object and is based on the CurrentCulture property information. (Overrides ValueTypeToString.)
Top
Operators
  NameDescription
Public operator Static member EqualityCompares two instances of FontStyle for equality.
Public operator Static member InequalityEvaluates two instances of FontStyle to determine inequality.
Top
Explicit Interface Implementations
  NameDescription
Explicit interface implemetation Private method IFormattableToStringFor a description of this member, see IFormattableToString.
Top
Remarks

Three terms categorize the slant of a font: normal, italic, and oblique.

Font style

Description

Normal

The characters in a normal, or roman, font are upright.

Italic

The characters in an italic font are truly slanted and appear as they were designed.

Oblique

The characters in an oblique font are artificially slanted. The slant is achieved by performing a shear transformation on the characters from a normal font. When a true italic font is not available on a computer or printer, an oblique style can generated from the normal font and used to simulate an italic font.

You can use the enumerated values of the FontStyles class to set the FontStyle structure.

Examples

The following example sets "Italic" as the FontStyle.

<TextBlock FontStyle="Italic">Italic font style</TextBlock>
Version Information

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.