Exporter (0) Imprimer
Développer tout

Typeface, classe

Represents a combination of FontFamily, FontWeight, FontStyle, and FontStretch.

Espace de noms: System.Windows.Media
Assembly : PresentationCore (dans presentationcore.dll)
Espace de noms XML :  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public class Typeface
public class Typeface
public class Typeface
Vous ne pouvez pas utiliser cette classe managée dans XAML.

A typeface is a single variation of a font within the same font family. An example of a typeface is an italic version of the "Times New Roman" font family. Typeface defines the weight, style and stretching features of a font.

Example of "Times New Roman" typefaces


Text showing bold and italic font styles

// 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;

System.Object
  System.Windows.Media.Typeface

Les membres statiques publics (Shared en Visual Basic) de ce type sont thread-safe. Il n'est pas garanti que les membres d'instance soient thread-safe.

Microsoft .NET Framework 3.0 est pris en charge sur Windows Vista, Microsoft Windows XP SP2 et Windows Server 2003 SP1.

.NET Framework

Prise en charge dans : 3.0

Ajouts de la communauté

AJOUTER
Afficher:
© 2014 Microsoft