Nasıl yapılır: Sistem Yazı Tiplerini Numaralandırma

Örnek

Aşağıdaki örnek, sistem yazı tipi koleksiyonunda yazı tiplerinin nasıl listelen olduğunu gösterir. içindeki her bir yazı tipi FontFamily aile SystemFontFamilies adı, birleşik giriş kutusuna öğe olarak eklenir.

public void FillFontComboBox(ComboBox comboBoxFonts)
{
    // Enumerate the current set of system fonts,
    // and fill the combo box with the names of the fonts.
    foreach (FontFamily fontFamily in Fonts.SystemFontFamilies)
    {
        // FontFamily.Source contains the font family name.
        comboBoxFonts.Items.Add(fontFamily.Source);
    }

    comboBoxFonts.SelectedIndex = 0;
}
Public Sub FillFontComboBox(ByVal comboBoxFonts As ComboBox)
    ' Enumerate the current set of system fonts,
    ' and fill the combo box with the names of the fonts.
    For Each fontFamily As FontFamily In Fonts.SystemFontFamilies
        ' FontFamily.Source contains the font family name.
        comboBoxFonts.Items.Add(fontFamily.Source)
    Next fontFamily

    comboBoxFonts.SelectedIndex = 0
End Sub

Aynı yazı tipi ailesinin birden çok sürümü aynı dizinde bulunuyorsa, Windows Presentation Foundation (WPF) yazı tipi numara listesi yazı tipinin en son sürümünü döndürür. Sürüm bilgileri çözüm sağlanmsa, en son zaman damgasına sahip yazı tipi döndürülür. Zaman damgası bilgileri eşdeğerse, alfabetik sırada ilk olan yazı tipi dosyası döndürülür.