FontMetrics Struct
The vertical metrics of a font: in font units for Font.Metrics, in pixels for Font.GetMetrics.
public readonly struct FontMetrics : IEquatable<FontMetrics>Remarks
Every value is a distance: its direction is the one its description gives, whatever the direction of the y axis.
- Implements
Properties
| Name | Description |
|---|---|
| Ascent | Gets the distance from the baseline to the top of a line, above the baseline. |
| CapHeight | Gets the height of the capital letters above the baseline, or 0 when the font does not declare it. |
| Descent | Gets the distance from the baseline to the bottom of a line, below the baseline. |
| LineGap | Gets the additional space the font recommends between two lines. |
| LineHeight | Gets the distance between two baselines the font recommends: FontMetrics.Ascent + FontMetrics.Descent + FontMetrics.LineGap. |
| StrikethroughPosition | Gets the distance from the baseline to the top of the strikethrough line, above the baseline. |
| StrikethroughThickness | Gets the thickness of the strikethrough line. |
| UnderlinePosition | Gets the distance from the baseline to the top of the underline, below the baseline. |
| UnderlineThickness | Gets the thickness of the underline. |
| XHeight | Gets the height of the lowercase letter x above the baseline, or 0 when the font does not declare it. |
Ascent
FontMetrics.csCapHeight
FontMetrics.csDescent
FontMetrics.csLineGap
FontMetrics.csLineHeight
FontMetrics.csGets the distance between two baselines the font recommends: FontMetrics.Ascent + FontMetrics.Descent + FontMetrics.LineGap.
public double LineHeight { get; }Property value
StrikethroughPosition
FontMetrics.csStrikethroughThickness
FontMetrics.csUnderlinePosition
FontMetrics.csUnderlineThickness
FontMetrics.csXHeight
FontMetrics.csMethods
| Name | Description |
|---|---|
| Equals(FontMetrics) | Indicates whether the current object is equal to another object of the same type. |
| Equals(object?) | Indicates whether this instance and a specified object are equal. |
| GetHashCode() | Returns the hash code for this instance. |
Equals overloads
Equals(FontMetrics)
FontMetrics.csIndicates whether the current object is equal to another object of the same type.
public bool Equals(FontMetrics other)Parameters
otherFontMetrics- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.
Equals(object?)
FontMetrics.csGetHashCode()
FontMetrics.csOperators
| Name | Description |
|---|---|
| operator ==(FontMetrics, FontMetrics) | Determines whether two values are equal. |
| operator !=(FontMetrics, FontMetrics) | Determines whether two values are different. |
operator ==(FontMetrics, FontMetrics)
FontMetrics.csDetermines whether two values are equal.
public static bool operator ==(FontMetrics left, FontMetrics right)Parameters
leftFontMetrics- The first value.
rightFontMetrics- The second value.
Returns
bool true when the values are equal.
operator !=(FontMetrics, FontMetrics)
FontMetrics.csDetermines whether two values are different.
public static bool operator !=(FontMetrics left, FontMetrics right)Parameters
leftFontMetrics- The first value.
rightFontMetrics- The second value.
Returns
bool true when the values are different.