FontStyle 結構
定義
定義結構,代表像是一般、斜體或傾斜的字體樣式。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
[<System.ComponentModel.TypeConverter(typeof(System.Windows.FontStyleConverter))>]
[<System.Windows.Localizability(System.Windows.LocalizationCategory.None)>]
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>
備註
有三個詞彙分類字型的傾斜度: normal、斜體和傾斜。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. |
ObliqueOblique | 傾斜字型中的字元是以人工傾斜的方式。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(FontStyle) |
比較 FontStyle 與目前的 FontStyle 執行個體是否相等。Compares a FontStyle with the current FontStyle instance for equality. |
Equals(Object) |
比較 Object 與目前的 FontStyle 執行個體是否相等。Compares an Object with the current FontStyle instance for equality. |
GetHashCode() |
擷取這個物件的雜湊碼。Retrieves the hash code for this object. |
ToString() |
建立 String,表示目前的 FontStyle 物件,且以 CurrentCulture 屬性資訊為基礎的。Creates a String that represents the current FontStyle object and is based on the CurrentCulture property information. |
運算子
Equality(FontStyle, FontStyle) |
比較 FontStyle 的兩個執行個體是否相等。Compares two instances of FontStyle for equality. |
Inequality(FontStyle, FontStyle) |
評估 FontStyle 的兩個執行個體,判斷兩者是否不相等。Evaluates two instances of FontStyle to determine inequality. |
明確介面實作
IFormattable.ToString(String, IFormatProvider) |
如需這個成員的說明,請參閱 ToString(String, IFormatProvider)。For a description of this member, see ToString(String, IFormatProvider). |