This documentation is archived and is not being maintained.

TextMetrics Structure

Provides basic information about the font specified by a visual style for a particular element.

Namespace:  System.Windows.Forms.VisualStyles
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public struct TextMetrics

The TextMetrics type exposes the following members.

Public propertyAscentGets or sets the ascent of characters in the font.
Public propertyAverageCharWidthGets or sets the average width of characters in the font.
Public propertyBreakCharGets or sets the character used to define word breaks for text justification.
Public propertyCharSetGets or sets the character set of the font.
Public propertyDefaultCharGets or sets the character to be substituted for characters not in the font.
Public propertyDescentGets or sets the descent of characters in the font.
Public propertyDigitizedAspectXGets or sets the horizontal aspect of the device for which the font was designed.
Public propertyDigitizedAspectYGets or sets the vertical aspect of the device for which the font was designed.
Public propertyExternalLeadingGets or sets the amount of extra leading that the application adds between rows.
Public propertyFirstCharGets or sets the first character defined in the font.
Public propertyHeightGets or sets the height of characters in the font.
Public propertyInternalLeadingGets or sets the amount of leading inside the bounds set by the Height property.
Public propertyItalicGets or sets a value indicating whether the font is italic.
Public propertyLastCharGets or sets the last character defined in the font.
Public propertyMaxCharWidthGets or sets the width of the widest character in the font.
Public propertyOverhangGets or sets the extra width per string that may be added to some synthesized fonts.
Public propertyPitchAndFamilyGets or sets information about the pitch, technology, and family of a physical font.
Public propertyStruckOutGets or sets a value indicating whether the font specifies a horizontal line through the characters.
Public propertyUnderlinedGets or sets a value indicating whether the font is underlined.
Public propertyWeightGets or sets the weight of the font.

Public methodEqualsIndicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeReturns the hash code for this instance. (Inherited from ValueType.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns the fully qualified type name of this instance. (Inherited from ValueType.)

The TextMetrics structure specifies the return values of the VisualStyleRenderer.GetTextMetrics method.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.