Struct DWriteUnderline
The DWRITE_UNDERLINE structure contains information about the size and placement of underlines. All coordinates are in device independent pixels (DIPs).
Implements
Inherited Members
Namespace: JeremyAnsel.DirectX.DWrite
Assembly: JeremyAnsel.DirectX.DWrite.dll
Syntax
public struct DWriteUnderline : IEquatable<DWriteUnderline>
Constructors
| Edit this page View SourceDWriteUnderline(float, float, float, float, DWriteReadingDirection, DWriteFlowDirection, string, DWriteMeasuringMode)
Initializes a new instance of the DWriteUnderline struct.
Declaration
public DWriteUnderline(float width, float thickness, float offset, float runHeight, DWriteReadingDirection readingDirection, DWriteFlowDirection flowDirection, string localeName, DWriteMeasuringMode measuringMode)
Parameters
Type | Name | Description |
---|---|---|
float | width | Width of the underline, measured parallel to the baseline. |
float | thickness | Thickness of the underline, measured perpendicular to the baseline. |
float | offset | Offset of the underline from the baseline. |
float | runHeight | Height of the tallest run where the underline applies. |
DWriteReadingDirection | readingDirection | Reading direction of the text associated with the underline. |
DWriteFlowDirection | flowDirection | Flow direction of the text associated with the underline. |
string | localeName | Locale of the text the underline is being drawn under. |
DWriteMeasuringMode | measuringMode | The measuring mode. |
Properties
| Edit this page View SourceFlowDirection
Gets or sets the flow direction of the text associated with the underline. This value is used to interpret whether the thickness value advances top to bottom, left to right, or right to left.
Declaration
public DWriteFlowDirection FlowDirection { get; set; }
Property Value
Type | Description |
---|---|
DWriteFlowDirection |
LocaleName
Gets or sets the locale of the text the underline is being drawn under. Can be pertinent where the locale affects how the underline is drawn. For example, in vertical text, the underline belongs on the left for Chinese but on the right for Japanese. This choice is completely left up to higher levels.
Declaration
public string LocaleName { get; set; }
Property Value
Type | Description |
---|---|
string |
MeasuringMode
Gets or sets the measuring mode can be useful to the renderer to determine how underlines are rendered, e.g. rounding the thickness to a whole pixel in GDI-compatible modes.
Declaration
public DWriteMeasuringMode MeasuringMode { get; set; }
Property Value
Type | Description |
---|---|
DWriteMeasuringMode |
Offset
Gets or sets the offset of the underline from the baseline. A positive offset represents a position below the baseline and a negative offset is above.
Declaration
public float Offset { get; set; }
Property Value
Type | Description |
---|---|
float |
ReadingDirection
Gets or sets the reading direction of the text associated with the underline. This value is used to interpret whether the width value runs horizontally or vertically.
Declaration
public DWriteReadingDirection ReadingDirection { get; set; }
Property Value
Type | Description |
---|---|
DWriteReadingDirection |
RunHeight
Gets or sets the height of the tallest run where the underline applies.
Declaration
public float RunHeight { get; set; }
Property Value
Type | Description |
---|---|
float |
Thickness
Gets or sets the thickness of the underline, measured perpendicular to the baseline.
Declaration
public float Thickness { get; set; }
Property Value
Type | Description |
---|---|
float |
Width
Gets or sets the width of the underline, measured parallel to the baseline.
Declaration
public float Width { get; set; }
Property Value
Type | Description |
---|---|
float |
Methods
| Edit this page View SourceEquals(DWriteUnderline)
Determines whether the specified object is equal to the current object.
Declaration
public bool Equals(DWriteUnderline other)
Parameters
Type | Name | Description |
---|---|---|
DWriteUnderline | 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 ==(DWriteUnderline, DWriteUnderline)
Compares two DWriteUnderline objects. The result specifies whether the values of the two objects are equal.
Declaration
public static bool operator ==(DWriteUnderline left, DWriteUnderline right)
Parameters
Type | Name | Description |
---|---|---|
DWriteUnderline | left | The left DWriteUnderline to compare. |
DWriteUnderline | right | The right DWriteUnderline to compare. |
Returns
Type | Description |
---|---|
bool |
operator !=(DWriteUnderline, DWriteUnderline)
Compares two DWriteUnderline objects. The result specifies whether the values of the two objects are unequal.
Declaration
public static bool operator !=(DWriteUnderline left, DWriteUnderline right)
Parameters
Type | Name | Description |
---|---|---|
DWriteUnderline | left | The left DWriteUnderline to compare. |
DWriteUnderline | right | The right DWriteUnderline to compare. |
Returns
Type | Description |
---|---|
bool |