FontWeight 結構

定義

以筆劃輕重表示字樣密度。

public value class FontWeight : IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.FontWeightConverter))]
[System.Windows.Localizability(System.Windows.LocalizationCategory.None)]
public struct FontWeight : IFormattable
[<System.ComponentModel.TypeConverter(typeof(System.Windows.FontWeightConverter))>]
[<System.Windows.Localizability(System.Windows.LocalizationCategory.None)>]
type FontWeight = struct
    interface IFormattable
Public Structure FontWeight
Implements IFormattable
繼承
FontWeight
屬性
實作

範例

在下列程式碼範例中,會將 FontWeight 設定為 「UltraBold」。

<TextBlock FontWeight="UltraBold" FontFamily="Gil Sans MT">Hello, world</TextBlock>

備註

相較于相同字樣中的「一般」字元,粗細通常會以與字樣中指定字元相關聯的增加筆劃或粗細來區分。

注意 並非所有粗細都適用于所有字樣。 當字樣無法使用權數時,會傳回最接近的相符權數。

XAML Attribute Usage

<object fontWeightProperty="fontWeightsValue"/>  

XAML 值

fontWeightsValue
屬性 FontWeights 名稱,例如 「Light」、「Normal」 或 「UltraBold」。

方法

Compare(FontWeight, FontWeight)

比較兩個 FontWeight 執行個體。

Equals(FontWeight)

判斷目前的 FontWeight 物件是否等於指定的 FontWeight 物件。

Equals(Object)

判斷目前的 FontWeight 物件是否等於指定的物件。

FromOpenTypeWeight(Int32)

建立對應至 OpenType usWeightClass 值的新 實例 FontWeight

GetHashCode()

擷取這個物件的雜湊碼。

ToOpenTypeWeight()

傳回值,表示物件的 FontWeight OpenType usWeightClass

ToString()

傳回表示 FontWeight 的物件值,且以 CurrentCulture 屬性資訊為基礎的文字字串。

運算子

Equality(FontWeight, FontWeight)

比較 FontWeight 的兩個執行個體是否相等。

GreaterThan(FontWeight, FontWeight)

評估 FontWeight 的兩個執行個體,判斷其中一個執行個體是否大於另一個。

GreaterThanOrEqual(FontWeight, FontWeight)

評估 FontWeight 的兩個執行個體,判斷其中一個執行個體是否大於或等於另一個。

Inequality(FontWeight, FontWeight)

評估 FontWeight 的兩個執行個體,判斷兩者是否不相等。

LessThan(FontWeight, FontWeight)

評估 FontWeight 的兩個執行個體,判斷其中一個執行個體是否小於另一個。

LessThanOrEqual(FontWeight, FontWeight)

評估 FontWeight 的兩個執行個體,判斷其中一個執行個體是否小於或等於另一個。

明確介面實作

IFormattable.ToString(String, IFormatProvider)

如需這個成員的說明,請參閱 ToString(String, IFormatProvider)

適用於

另請參閱