Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
0 out of 1 rated this helpful - Rate this topic

FontWeight Structure

Refers to the density of a typeface, in terms of the lightness or heaviness of the strokes.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)
public struct FontWeight
<object property="fontWeightsPropertyName"/>

XAML Values

fontWeightsPropertyName

A FontWeights static property name, such as Light, Normal, or Bold.

The FontWeight type exposes the following members.

  NameDescription
Public methodSupported by Silverlight for Windows PhoneEqualsDetermines whether the current FontWeight object is equal to a specified object. (Overrides ValueType.Equals(Object).)
Protected methodSupported by Silverlight for Windows PhoneFinalizeAllows 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 PhoneGetHashCodeRetrieves the hash code for this object. (Overrides ValueType.GetHashCode().)
Public methodSupported by Silverlight for Windows PhoneGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneToStringReturns a text string that represents the value of the FontWeight object. (Overrides ValueType.ToString().)
Top
  NameDescription
Public operatorStatic memberSupported by Silverlight for Windows PhoneEqualityCompares two instances of FontWeight for equality.
Public operatorStatic memberSupported by Silverlight for Windows PhoneInequalityEvaluates two instances of FontWeight to determine inequality.
Top

Weight differences are generally differentiated by an increased stroke or thickness that is associated with a given character in a typeface, as compared to a "normal" character from that same typeface.

Note   Not all weights are available for all typefaces. When a weight is not available for a typeface, the closest matching weight is returned.

This structure provides compatibility between Silverlight and WPF properties that specify a font weight. The compatibility requirement is that in JavaScript API for Silverlight, the relevant properties referenced FontWeight, which is an enumeration, whereas WPF relevant properties referenced FontWeights, a class with static properties.

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

FontWeights Static Property Names

Font weight

usWeightClass

Thin

100

ExtraLight

200

Light

300

Normal

400

Medium

500

SemiBold

600

Bold

700

ExtraBold

800

Black

900

ExtraBlack

950

The FontWeights values correspond to the usWeightClass definition in the OpenType specification. The usWeightClass represents an integer value between 1 and 999. Lower values indicate lighter weights; higher values indicate heavier weights.

Do not use the value UltraBold; this value is not supported by Silverlight 5.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

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

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.