FontStretch 结构

定义

描述与某个字体与该字体的正常纵横比相比的拉伸程度。Describes the degree to which a font has been stretched compared to the normal aspect ratio of that font.

public value class FontStretch : IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.FontStretchConverter))]
[System.Windows.Localizability(System.Windows.LocalizationCategory.None)]
public struct FontStretch : IFormattable
type FontStretch = struct
    interface IFormattable
Public Structure FontStretch
Implements IFormattable
继承
FontStretch
属性
实现

注解

字体拉伸描述了字体格式从其正常纵横比延伸到的程度, 这是字体中标志符号的原始宽度与高度的比值。A font stretch describes the degree to which a font form is stretched from its normal aspect ratio, which is the original width to height ratio specified for the glyphs in the font.

值对应于OpenTypeOpenType规范中usWidthClass的定义。 FontStretchesThe FontStretches values correspond to the usWidthClass definition in the OpenTypeOpenType specification. usWidthClass表示介于1到9之间的整数值指示较宽的宽度; 值越高表示宽度更宽。The usWidthClass represents an integer value between 1 and 9 - lower values indicate narrower widths; higher values indicate wider widths.

字体拉伸Font stretch usWidthClassusWidthClass 正常百分比% of normal
UltraCondensed 11 50.0%50.0%
ExtraCondensed 22 62.5%62.5%
Condensed 33 75.0%75.0%
SemiCondensed 44 87.5%87.5%
Medium 55 100.0%100.0%
SemiExpanded 66 112.5%112.5%
Expanded 77 125.0%125.0%
ExtraExpanded 88 150.0%150.0%
UltraExpanded 99 200.0%200.0%

有关 opentype usWidthClass值的详细信息, 请参阅 opentype 规范的usWidthClass部分。For more information on the OpenType usWidthClass value, see the usWidthClass section of the OpenType specification.

XAML 属性用法XAML Attribute Usage

<object fontStretchesProperty="fontStretchesValue"/>  

XAML 值XAML Values

fontStretchesValuefontStretchesValue
表示为名称字符串的值,例如"紧缩"、"Normal"或"加宽"。FontStretchesA FontStretches value expressed as the name string, such as "Condensed", "Normal", or "Expanded".

方法

Compare(FontStretch, FontStretch)

比较 FontStretch 对象的两个实例。Compares two instances of FontStretch objects.

Equals(FontStretch)

FontStretch 对象与当前 FontStretch 对象进行比较。Compares a FontStretch object with the current FontStretch object.

Equals(Object)

Object 与当前 FontStretch 对象进行比较。Compares a Object with the current FontStretch object.

FromOpenTypeStretch(Int32)

创建 FontStretch 的一个新实例,该实例对应于 OpenTypeOpenType usStretchClass 值。Creates a new instance of FontStretch that corresponds to the OpenTypeOpenType usStretchClass value.

GetHashCode()

检索此对象的哈希代码。Retrieves the hash code for this object.

ToOpenTypeStretch()

返回一个值,该值表示此 FontStretch 对象的 OpenTypeOpenType usStretchClassReturns a value that represents the OpenTypeOpenType usStretchClass for this FontStretch object.

ToString()

基于当前区域性创建当前 String 对象的 FontStretch 表示形式。Creates a String representation of the current FontStretch object based on the current culture.

运算符

Equality(FontStretch, FontStretch)

比较 FontStretch 的两个实例是否相等。Compares two instances of FontStretch for equality.

GreaterThan(FontStretch, FontStretch)

FontStretch 的两个实例进行计算,以确定其中一个实例是否大于另一个实例。Evaluates two instances of FontStretch to determine if one instance is greater than the other.

GreaterThanOrEqual(FontStretch, FontStretch)

FontStretch 的两个实例进行计算,以确定其中一个实例是否大于或等于另一个实例。Evaluates two instances of FontStretch to determine whether one instance is greater than or equal to the other.

Inequality(FontStretch, FontStretch)

FontStretch 的两个实例进行评估,以确定它们是否不相等。Evaluates two instances of FontStretch to determine inequality.

LessThan(FontStretch, FontStretch)

FontStretch 的两个实例进行计算,以确定其中一个实例是否小于另一个实例。Evaluates two instances of FontStretch to determine whether one instance is less than the other.

LessThanOrEqual(FontStretch, FontStretch)

FontStretch 的两个实例进行计算,以确定其中一个实例是否小于或等于另一个实例。Evaluates two instances of FontStretch to determine whether one instance is less than or equal to the other.

显式接口实现

IFormattable.ToString(String, IFormatProvider)

有关此成员的说明,请参见 ToString(String, IFormatProvider)For a description of this member, see ToString(String, IFormatProvider).

适用于

另请参阅