FontStyle 結構

定義

定義結構,表示字型臉部的樣式為一般、斜體或斜體。

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

範例

以下範例將 為 "Italic"FontStyle

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

備註

字體的傾斜有三個術語:正常、斜體和斜體。

字型樣式 Description
正常 一般字體或羅馬字體的字體是直立的。
斜體字 斜體字體的字體確實傾斜,呈現出設計的樣貌。
斜向 斜字體中的字體是人為傾斜的。 斜面是透過從一般字型對字元進行剪切變換來達成的。 當電腦或印表機無法使用真正的斜體字型時,可以從一般字型產生斜體樣式,並用來模擬斜體字型。

你可以用類別列舉的值 FontStyles 來設定 FontStyle 結構。

XAML 屬性使用方式

<object fontStyleProperty="fontStylesValue"/>

XAML 值

fontStylesValue 一個 FontStyles 數值,例如「正常」、「斜體」或「斜體」。

方法

名稱 Description
Equals(FontStyle)

將 a FontStyle 與當前 FontStyle 實例比較以取得相等。

Equals(Object)

將 與 Object 當前 FontStyle 實例比較以取得相等。

GetHashCode()

取得此物件的雜湊碼。

ToString()

建立 String 一個代表當前 FontStyle 物件,並基於 CurrentCulture 屬性資訊。

操作員

名稱 Description
Equality(FontStyle, FontStyle)

比較兩個 的 FontStyle 實例,為相等。

Inequality(FontStyle, FontStyle)

評估兩個案例 FontStyle 以判定不平等。

明確介面實作

名稱 Description
IFormattable.ToString(String, IFormatProvider)

關於此成員的描述,請參見 ToString(String, IFormatProvider)

適用於

另請參閱