Typeface 類別

定義

表示 FontFamilyFontWeightFontStyleFontStretch 的結合。

public ref class Typeface
public class Typeface
type Typeface = class
Public Class Typeface
繼承
Typeface

範例

// Return the typeface collection for the fonts in the selected URI location.
System.Collections.Generic.ICollection<Typeface> typefaces = Fonts.GetTypefaces("file:///C:\\Windows\\Fonts\\#Georgia");

// Enumerate the typefaces in the collection.
foreach (Typeface face in typefaces)
{
    // Separate the URI directory source info from the font family name.
    string[] familyName = face.FontFamily.Source.Split('#');

    // Add the font family name, weight, and style values to the typeface combo box.
    comboBoxTypeface.Items.Add(familyName[familyName.Length - 1] + " " + face.Weight + " " + face.Style);
}

comboBoxTypeface.SelectedIndex = 0;
' Return the typeface collection for the fonts in the selected URI location.
Dim typefaces As System.Collections.Generic.ICollection(Of Typeface) = Fonts.GetTypefaces("file:///C:\Windows\Fonts\#Georgia")

' Enumerate the typefaces in the collection.
For Each face As Typeface In typefaces
    ' Separate the URI directory source info from the font family name.
    Dim familyName() As String = face.FontFamily.Source.Split("#"c)

    ' Add the font family name, weight, and style values to the typeface combo box.
    comboBoxTypeface.Items.Add(familyName(familyName.Length - 1) & " " & face.Weight.ToString & " " & face.Style.ToString)
Next face

comboBoxTypeface.SelectedIndex = 0

備註

字型是相同字型系列內字型的單一變化。 字型的範例是「Times New Roman」 字型系列的斜體版本。 字樣會定義字型的粗細、樣式和延展功能。

建構函式

Typeface(FontFamily, FontStyle, FontWeight, FontStretch)

為指定的字型系列字樣名稱、TypefaceStyleWeight 值,初始化 Stretch 類別的新執行個體。

Typeface(FontFamily, FontStyle, FontWeight, FontStretch, FontFamily)

為指定的字型系列字樣名稱、TypefaceStyleWeight 值,初始化 Stretch 類別的新執行個體。 此外,也會指定後援字型系列。

Typeface(String)

為指定的字型系列字樣名稱初始化 Typeface 類別的新執行個體。

屬性

CapsHeight

取得從基準線到字樣英文大寫字母頂端的距離。

FaceNames

取得 Typeface 的特定文化特性名稱集合。

FontFamily

取得從中建構字樣的字型系列名稱。

IsBoldSimulated

判斷是否模擬 Typeface 所表示之圖像的粗體。

IsObliqueSimulated

判斷是否模擬 Typeface 所表示之圖像的斜體字樣。

Stretch

取得 Typeface 的自動縮放值。 自動縮放值可決定字樣在顯示時是要擴展或壓縮。

StrikethroughPosition

取得值,指出從基準線到字樣刪除線的距離。

StrikethroughThickness

取得值,指出相對於字型 em 大小的刪除線粗細。

Style

取得 Typeface 的樣式。

UnderlinePosition

取得值,這個值表示從字樣基準到底線的距離。

UnderlineThickness

取得值,這個值表示底線粗細,以相對於字樣字型 em 大小的值表示。

Weight

取得字樣的相對粗細。

XHeight

取得從基準線到字樣英文小寫字母頂端的距離。 距離不包含上格。

方法

Equals(Object)

取得值,這個值表示目前的字樣和指定的字樣是否擁有相同的 FontFamilyStyleWeightStretch 和後援字型值。

GetHashCode()

作為 Typeface 的雜湊函式。 它適用於雜湊演算法和資料結構,例如雜湊資料表。

GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)
TryGetGlyphTypeface(GlyphTypeface)

擷取對應至 GlyphTypefaceTypeface

適用於