FontStyle Structure

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Represents the style of a font face (for instance, as normal or italic).

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Public Structure FontStyle
public struct FontStyle
<object property="fontStylesPropertyName"/>

XAML Values

  • fontStylesPropertyName
    A static FontStyles property name, such as Normal or Italic.

The FontStyle type exposes the following members.

Methods

  Name Description
Public methodSupported by Silverlight for Windows Phone Equals Compares an object with the current FontStyle instance for equality. (Overrides ValueType.Equals(Object).)
Protected methodSupported by Silverlight for Windows Phone Finalize Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone GetHashCode Retrieves the hash code for this object. (Overrides ValueType.GetHashCode().)
Public methodSupported by Silverlight for Windows Phone GetType Gets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows Phone MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows Phone ToString Creates a string that represents the current FontStyle object. (Overrides ValueType.ToString().)

Top

Operators

  Name Description
Public operatorStatic memberSupported by Silverlight for Windows Phone Equality Compares two instances of FontStyle for equality.
Public operatorStatic memberSupported by Silverlight for Windows Phone Inequality Evaluates two instances of FontStyle to determine inequality.

Top

Remarks

This structure provides compatibility between Silverlight JavaScript and WPF properties that specify a font style. The compatibility requirement is that in JavaScript, the relevant properties referenced FontStyle, which is an enumeration, whereas WPF relevant properties referenced FontStyles, a class with static properties.

FontStyle is the value type for Silverlight properties or attributes that specify a font style value, but you must use static properties of FontStyles to provide a FontStyle value. In XAML, you specify the name of a FontStyles property as the attribute value. This functionality is enabled by native XAML parsing behavior that processes the string value.

WPF supports a FontStyles value of Oblique. Silverlight 5 does not support an Oblique value.

FontStyles Static Property Names

Font style

Description

Italic

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

Normal

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

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

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.

See Also

Reference