FontFamily.FamilyTypefaces 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取 FontFamily 对象的字体集合。
public:
property System::Windows::Media::FamilyTypefaceCollection ^ FamilyTypefaces { System::Windows::Media::FamilyTypefaceCollection ^ get(); };
public System.Windows.Media.FamilyTypefaceCollection FamilyTypefaces { get; }
member this.FamilyTypefaces : System.Windows.Media.FamilyTypefaceCollection
Public ReadOnly Property FamilyTypefaces As FamilyTypefaceCollection
属性值
一个 FamilyTypefaceCollection,表示 FontFamily 对象的字体集合。
示例
// Return the font family for the selected font name.
FontFamily fontFamily = new FontFamily("Arial Narrow");
// Return the family typeface collection for the font family.
FamilyTypefaceCollection familyTypefaceCollection = fontFamily.FamilyTypefaces;
// Enumerate the family typefaces in the collection.
foreach (FamilyTypeface typeface in familyTypefaceCollection)
{
// Add the typeface style values to the styles combo box.
comboBoxStyles.Items.Add(typeface.Style);
}
comboBoxStyles.SelectedIndex = 0;
' Return the font family for the selected font name.
Dim fontFamily As New FontFamily("Arial Narrow")
' Return the family typeface collection for the font family.
Dim familyTypefaceCollection As FamilyTypefaceCollection = fontFamily.FamilyTypefaces
' Enumerate the family typefaces in the collection.
For Each typeface As FamilyTypeface In familyTypefaceCollection
' Add the typeface style values to the styles combo box.
comboBoxStyles.Items.Add(typeface.Style)
Next typeface
comboBoxStyles.SelectedIndex = 0
注解
XAML 属性元素用法
<object>
<object.FamilyTypefaces>
<OneOrMoreFontFamilyTypefaces/>
</object.FamilyTypefaces>
</object>
XAML 值
OneOrMoreFontFamilyTypefaces
对象的一个或多个字样 FontFamily 。