Typeface Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a combination of FontFamily, FontWeight, FontStyle, and FontStretch.
public ref class Typeface
public class Typeface
type Typeface = class
Public Class Typeface
- Inheritance
-
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
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.
Typeface(Font |
Initializes a new instance of the Typeface class for the specified font family name, Style, Weight, and Stretch values. In addition, a fallback font family is specified. |
Typeface(Font |
Initializes a new instance of the Typeface class for the specified font family name, Style, Weight, and Stretch values. |
Typeface(String) |
Initializes a new instance of the Typeface class for the specified font family typeface name. |
Caps |
Gets the distance from the baseline to the top of an English capital letter for the typeface. |
Face |
Gets a collection of culture-specific names for the Typeface. |
Font |
Gets the name of the font family from which the typeface was constructed. |
Is |
Determines whether to simulate a bold weight for the glyphs represented by the Typeface. |
Is |
Determines whether to simulate an italic style for the glyphs represented by the Typeface. |
Stretch |
Gets the stretch value for the Typeface. The stretch value determines whether a typeface is expanded or condensed when it is displayed. |
Strikethrough |
Gets a value that indicates the distance from the baseline to the strikethrough for the typeface. |
Strikethrough |
Gets a value that indicates the thickness of the strikethrough relative to the font em size. |
Style |
Gets the style of the Typeface. |
Underline |
Gets a value that indicates the distance of the underline from the baseline for the typeface. |
Underline |
Gets a value that indicates the thickness of the underline relative to the font em size for the typeface. |
Weight |
Gets the relative weight of the typeface. |
XHeight |
Gets the distance from the baseline to the top of an English lowercase letter for a typeface. The distance excludes ascenders. |
Equals(Object) |
Gets a value that indicates whether the current typeface and the specified typeface have the same FontFamily, Style, Weight, Stretch, and fallback font values. |
Get |
Serves as a hash function for Typeface. It is suitable for use in hashing algorithms and data structures such as a hash table. |
Get |
Gets the Type of the current instance. (Inherited from Object) |
Memberwise |
Creates a shallow copy of the current Object. (Inherited from Object) |
To |
Returns a string that represents the current object. (Inherited from Object) |
Try |
Retrieves the GlyphTypeface that corresponds to the Typeface. |
Producto | Versiones |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
Comentarios de .NET
.NET es un proyecto de código abierto. Seleccione un vínculo para proporcionar comentarios: