Typography.Variants プロパティ

定義

使用される標準的なタイポグラフィ形式のバリエーションを示す FontVariants 列挙値を取得または設定します。

public:
 property System::Windows::FontVariants Variants { System::Windows::FontVariants get(); void set(System::Windows::FontVariants value); };
public System.Windows.FontVariants Variants { get; set; }
member this.Variants : System.Windows.FontVariants with get, set
Public Property Variants As FontVariants

プロパティ値

FontVariants

FontVariants 列挙値。 既定値は Normal です。

注釈

このプロパティは、プロパティを所有するオブジェクトの値を Typography 取得または設定します。これは、クラス インスタンスにアクセスする唯一の Typography 方法です。 さらに、このプロパティは、XAML のテキストを含むオブジェクトに設定できるように、添付プロパティの使用法をサポートしています。

バリアントは、上付きまたは下付き文字のフォント フォームに似ています。 フォント フォームには、上付き文字と序数形式の間、または下付き文字と下位フォームの間で異なるグリフ セットを含める場合があります。 Variants プロパティを使用すると、OpenType フォントに上付き文字と下付き文字の値を設定することができます。

次のテキストは、Palatino Linotype フォントの上付き文字を示したものです。

OpenType の上付き文字を使用するテキスト
上付きの例

次のコード例は、プロパティを使用して、Palatino Linotype フォントの上付き文字を定義する方法を Variants 示しています。

<Paragraph FontFamily="Palatino Linotype">
  2<Run Typography.Variants="Superscript">3</Run>
  14<Run Typography.Variants="Superscript">th</Run>
</Paragraph>

次のテキストは、Palatino Linotype フォントの下付き文字を示したものです。

OpenType の下付き文字を使用するテキスト
下付き文字の例

次のコード例は、プロパティを使用して、Palatino Linotype フォントの添字を定義する方法を Variants 示しています。

<Paragraph FontFamily="Palatino Linotype">
  H<Run Typography.Variants="Subscript">2</Run>O
  Footnote<Run Typography.Variants="Subscript">4</Run>
</Paragraph>

バリアントをサポートしていないフォントは、フォント フォームのアルゴリズム近似値を持つ場合があります。

XAML 属性の使用方法

<object Typography.Variants="FontVariants"/>

依存プロパティ情報

識別子フィールド VariantsProperty
に設定されたメタデータ プロパティ true AffectsMeasureAffectsRenderInherits

適用対象