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
Normal 普通字体或罗马字体中的字符是直立的。
斜体 斜体字体中的字符确实倾斜,在设计时出现。
倾斜字体中的字符被人为倾斜。 倾斜是通过对普通字体中的字符执行剪切转换来实现的。 当计算机或打印机上没有真正的斜体字体时,倾斜样式可以从普通字体生成,并用于模拟斜体字体。

可以使用类的 FontStyles 枚举值来设置 FontStyle 结构。

XAML 属性用法

<object fontStyleProperty="fontStylesValue"/>

XAML 值

fontStylesValueFontStyles ,如“Normal”、“Italic”或“Oblique”。

方法

名称 说明
Equals(FontStyle)

比较 FontStyle 当前 FontStyle 实例是否相等。

Equals(Object)

比较 Object 当前 FontStyle 实例是否相等。

GetHashCode()

检索此对象的哈希代码。

ToString()

创建一个 String 表示当前 FontStyle 对象并基于 CurrentCulture 属性信息。

运营商

名称 说明
Equality(FontStyle, FontStyle)

比较两个 FontStyle 相等实例。

Inequality(FontStyle, FontStyle)

评估两个 FontStyle 确定不相等的实例。

显式接口实现

名称 说明
IFormattable.ToString(String, IFormatProvider)

有关此成员的说明,请参阅 ToString(String, IFormatProvider)

适用于

另请参阅