Struct DWriteTextMetrics
Overall metrics associated with text after layout. All coordinates are in device independent pixels (DIPs).
Implements
Inherited Members
Namespace: JeremyAnsel.DirectX.DWrite
Assembly: JeremyAnsel.DirectX.DWrite.dll
Syntax
public struct DWriteTextMetrics : IEquatable<DWriteTextMetrics>
Properties
| Edit this page View SourceHeight
Gets the height of the formatted text. The height of an empty string is determined by the size of the default font's line height.
Declaration
public float Height { get; }
Property Value
Type | Description |
---|---|
float |
LayoutHeight
Gets the initial height given to the layout. Depending on the length of the text, it may be larger or smaller than the text content height.
Declaration
public float LayoutHeight { get; }
Property Value
Type | Description |
---|---|
float |
LayoutWidth
Gets the initial width given to the layout. Depending on whether the text was wrapped or not, it can be either larger or smaller than the text content width.
Declaration
public float LayoutWidth { get; }
Property Value
Type | Description |
---|---|
float |
Left
Gets the left-most point of formatted text relative to layout box (excluding any glyph overhang).
Declaration
public float Left { get; }
Property Value
Type | Description |
---|---|
float |
LineCount
Gets the total number of lines.
Declaration
public uint LineCount { get; }
Property Value
Type | Description |
---|---|
uint |
MaxBidiReorderingDepth
Gets the maximum reordering count of any line of text, used to calculate the most number of hit-testing boxes needed. If the layout has no bidirectional text or no text at all, the minimum level is 1.
Declaration
public uint MaxBidiReorderingDepth { get; }
Property Value
Type | Description |
---|---|
uint |
Top
Gets the top-most point of formatted text relative to layout box (excluding any glyph overhang).
Declaration
public float Top { get; }
Property Value
Type | Description |
---|---|
float |
Width
Gets the width of the formatted text ignoring trailing whitespace at the end of each line.
Declaration
public float Width { get; }
Property Value
Type | Description |
---|---|
float |
WidthIncludingTrailingWhitespace
Gets the width of the formatted text taking into account the trailing whitespace at the end of each line.
Declaration
public float WidthIncludingTrailingWhitespace { get; }
Property Value
Type | Description |
---|---|
float |
Methods
| Edit this page View SourceEquals(DWriteTextMetrics)
Determines whether the specified object is equal to the current object.
Declaration
public bool Equals(DWriteTextMetrics other)
Parameters
Type | Name | Description |
---|---|---|
DWriteTextMetrics | 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 ==(DWriteTextMetrics, DWriteTextMetrics)
Compares two DWriteTextMetrics objects. The result specifies whether the values of the two objects are equal.
Declaration
public static bool operator ==(DWriteTextMetrics left, DWriteTextMetrics right)
Parameters
Type | Name | Description |
---|---|---|
DWriteTextMetrics | left | The left DWriteTextMetrics to compare. |
DWriteTextMetrics | right | The right DWriteTextMetrics to compare. |
Returns
Type | Description |
---|---|
bool |
operator !=(DWriteTextMetrics, DWriteTextMetrics)
Compares two DWriteTextMetrics objects. The result specifies whether the values of the two objects are unequal.
Declaration
public static bool operator !=(DWriteTextMetrics left, DWriteTextMetrics right)
Parameters
Type | Name | Description |
---|---|---|
DWriteTextMetrics | left | The left DWriteTextMetrics to compare. |
DWriteTextMetrics | right | The right DWriteTextMetrics to compare. |
Returns
Type | Description |
---|---|
bool |