Struct DWriteFontMetrics
The DWRITE_FONT_METRICS structure specifies the metrics of a font face that are applicable to all glyphs within the font face.
Implements
Inherited Members
Namespace: JeremyAnsel.DirectX.DWrite
Assembly: JeremyAnsel.DirectX.DWrite.dll
Syntax
public struct DWriteFontMetrics : IEquatable<DWriteFontMetrics>
Properties
| Edit this page View SourceAscent
Gets the ascent value of the font face in font design units. Ascent is the distance from the top of font character alignment box to English baseline.
Declaration
public ushort Ascent { get; }
Property Value
Type | Description |
---|---|
ushort |
CapitalHeight
Gets the cap height value of the font face in font design units. Cap height is the distance from English baseline to the top of a typical English capital. Capital "H" is often used as a reference character for the purpose of calculating the cap height value.
Declaration
public ushort CapitalHeight { get; }
Property Value
Type | Description |
---|---|
ushort |
Descent
Gets the descent value of the font face in font design units. Descent is the distance from the bottom of font character alignment box to English baseline.
Declaration
public ushort Descent { get; }
Property Value
Type | Description |
---|---|
ushort |
DesignUnitsPerEM
Gets the number of font design units per em unit. Font files use their own coordinate system of font design units. A font design unit is the smallest measurable unit in the em square, an imaginary square that is used to size and align glyphs. The concept of em square is used as a reference scale factor when defining font size and device transformation semantics. The size of one em square is also commonly used to compute the paragraph indentation value.
Declaration
public ushort DesignUnitsPerEM { get; }
Property Value
Type | Description |
---|---|
ushort |
LetterXHeight
Gets the x-height value of the font face in font design units. x-height is the distance from English baseline to the top of lowercase letter "x", or a similar lowercase character.
Declaration
public ushort LetterXHeight { get; }
Property Value
Type | Description |
---|---|
ushort |
LineGap
Gets the line gap in font design units. Recommended additional white space to add between lines to improve legibility. The recommended line spacing (baseline-to-baseline distance) is thus the sum of ascent, descent, and lineGap. The line gap is usually positive or zero but can be negative, in which case the recommended line spacing is less than the height of the character alignment box.
Declaration
public short LineGap { get; }
Property Value
Type | Description |
---|---|
short |
StrikethroughPosition
Gets the strikethrough position value of the font face in font design units. Strikethrough position is the position of strikethrough relative to the English baseline. The value is usually made positive in order to place the strikethrough above the baseline.
Declaration
public short StrikethroughPosition { get; }
Property Value
Type | Description |
---|---|
short |
StrikethroughThickness
Gets the suggested strikethrough thickness value of the font face in font design units.
Declaration
public ushort StrikethroughThickness { get; }
Property Value
Type | Description |
---|---|
ushort |
UnderlinePosition
Gets the underline position value of the font face in font design units. Underline position is the position of underline relative to the English baseline. The value is usually made negative in order to place the underline below the baseline.
Declaration
public short UnderlinePosition { get; }
Property Value
Type | Description |
---|---|
short |
UnderlineThickness
Gets the suggested underline thickness value of the font face in font design units.
Declaration
public ushort UnderlineThickness { get; }
Property Value
Type | Description |
---|---|
ushort |
Methods
| Edit this page View SourceEquals(DWriteFontMetrics)
Determines whether the specified object is equal to the current object.
Declaration
public bool Equals(DWriteFontMetrics other)
Parameters
Type | Name | Description |
---|---|---|
DWriteFontMetrics | other | The object to compare with the current object. |
Returns
Type | Description |
---|---|
bool |
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceGetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
Operators
| Edit this page View Sourceoperator ==(DWriteFontMetrics, DWriteFontMetrics)
Compares two DWriteFontMetrics objects. The result specifies whether the values of the two objects are equal.
Declaration
public static bool operator ==(DWriteFontMetrics left, DWriteFontMetrics right)
Parameters
Type | Name | Description |
---|---|---|
DWriteFontMetrics | left | The left DWriteFontMetrics to compare. |
DWriteFontMetrics | right | The right DWriteFontMetrics to compare. |
Returns
Type | Description |
---|---|
bool |
operator !=(DWriteFontMetrics, DWriteFontMetrics)
Compares two DWriteFontMetrics objects. The result specifies whether the values of the two objects are unequal.
Declaration
public static bool operator !=(DWriteFontMetrics left, DWriteFontMetrics right)
Parameters
Type | Name | Description |
---|---|---|
DWriteFontMetrics | left | The left DWriteFontMetrics to compare. |
DWriteFontMetrics | right | The right DWriteFontMetrics to compare. |
Returns
Type | Description |
---|---|
bool |