Typeface.Weight 属性

定义

获取字样的相对粗细。

public:
 property System::Windows::FontWeight Weight { System::Windows::FontWeight get(); };
public System.Windows.FontWeight Weight { get; }
member this.Weight : System.Windows.FontWeight
Public ReadOnly Property Weight As FontWeight

属性值

FontWeight

一个表示字样相对粗细的 FontWeight 值。

示例

// Get the font weight value for the typeface.
FontWeight fontWeight = typeface.Weight;

if (fontWeight == FontWeights.ExtraBold)
{
    // Perform action based on extra bold weight value.
}
' Get the font weight value for the typeface.
Dim fontWeight As FontWeight = typeface.Weight

If fontWeight = FontWeights.ExtraBold Then
    ' Perform action based on extra bold weight value.
End If

注解

与同一字面中的“普通”字符相比,权重差异通常由与字面中给定字符关联的笔划或粗细来区分。

注意 并非所有权重都可用于所有字样。 当粗细不适用于字面时,将返回最接近的匹配权重。

适用于