FontStyle FontStyle FontStyle FontStyle Struct

定義

定義結構,代表像是一般、斜體或傾斜的字體樣式。Defines a structure that represents the style of a font face as normal, italic, or oblique.

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

範例

下列範例會將"Italic"FontStyle為。The following example sets "Italic" as the FontStyle.

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

備註

三個詞彙分類字型的斜面: [一般]、[斜體] 和 [傾斜]。Three terms categorize the slant of a font: normal, italic, and oblique.

字型樣式Font style 說明Description
一般Normal 一般或羅馬字型中的字元是直立的。The characters in a normal, or roman, font are upright.
斜體Italic 斜體字型中的字元會真正傾斜, 並以其設計方式顯示。The characters in an italic font are truly slanted and appear as they were designed.
斜角Oblique 傾斜字型中的字元是人為傾斜。The characters in an oblique font are artificially slanted. 您可以在標準字型的字元上執行「切變」轉換來完成此斜面。The slant is achieved by performing a shear transformation on the characters from a normal font. 當電腦或印表機上無法使用真斜體字型時, 傾斜樣式可以從一般字型產生, 並用來模擬斜體字型。When a true italic font is not available on a computer or printer, an oblique style can generated from the normal font and used to simulate an italic font.

您可以使用FontStyles類別的列舉值來FontStyle設定結構。You can use the enumerated values of the FontStyles class to set the FontStyle structure.

XAML Attribute UsageXAML Attribute Usage

<object fontStyleProperty="fontStylesValue"/>  

XAML 值XAML Values

fontStylesValuefontStylesValue
FontStyles值, 例如「一般」、「斜體」或「傾斜」。A FontStyles value, such as "Normal", "Italic", or "Oblique".

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

比較 Object 與目前的 FontStyle 執行個體是否相等。Compares an Object with the current FontStyle instance for equality.

Equals(FontStyle) Equals(FontStyle) Equals(FontStyle) Equals(FontStyle)

比較 FontStyle 與目前的 FontStyle 執行個體是否相等。Compares a FontStyle with the current FontStyle instance for equality.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

擷取這個物件的雜湊碼。Retrieves the hash code for this object.

ToString() ToString() ToString() ToString()

建立 String,表示目前的 FontStyle 物件,且以 CurrentCulture 屬性資訊為基礎的。Creates a String that represents the current FontStyle object and is based on the CurrentCulture property information.

運算子

Equality(FontStyle, FontStyle) Equality(FontStyle, FontStyle) Equality(FontStyle, FontStyle) Equality(FontStyle, FontStyle)

比較 FontStyle 的兩個執行個體是否相等。Compares two instances of FontStyle for equality.

Inequality(FontStyle, FontStyle) Inequality(FontStyle, FontStyle) Inequality(FontStyle, FontStyle) Inequality(FontStyle, FontStyle)

評估 FontStyle 的兩個執行個體,判斷兩者是否不相等。Evaluates two instances of FontStyle to determine inequality.

明確介面實作

IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider) IFormattable.ToString(String, IFormatProvider)

如需這個成員的說明,請參閱 ToString(String, IFormatProvider)For a description of this member, see ToString(String, IFormatProvider).

適用於

另請參閱