Table of Contents

Struct OutlineSegment

Namespace
Stride.CommunityToolkit.Rendering.Text
Assembly
Stride.CommunityToolkit.dll

One piece of a GlyphContour: a line or a Bézier curve from the previous segment's end to End.

public readonly record struct OutlineSegment : IEquatable<OutlineSegment>
Implements
Inherited Members

Constructors

OutlineSegment(OutlineSegmentKind, Vector2, Vector2, Vector2)

One piece of a GlyphContour: a line or a Bézier curve from the previous segment's end to End.

public OutlineSegment(OutlineSegmentKind Kind, Vector2 Control1, Vector2 Control2, Vector2 End)

Parameters

Kind OutlineSegmentKind

The kind of curve.

Control1 Vector2

The control point of a quadratic, or the first of a cubic; unused for a line.

Control2 Vector2

The second control point of a cubic; unused otherwise.

End Vector2

Where the segment ends, in EM units.

Properties

Control1

The control point of a quadratic, or the first of a cubic; unused for a line.

public Vector2 Control1 { get; init; }

Property Value

Vector2

Control2

The second control point of a cubic; unused otherwise.

public Vector2 Control2 { get; init; }

Property Value

Vector2

End

Where the segment ends, in EM units.

public Vector2 End { get; init; }

Property Value

Vector2

Kind

The kind of curve.

public OutlineSegmentKind Kind { get; init; }

Property Value

OutlineSegmentKind

Methods

Cubic(Vector2, Vector2, Vector2)

A cubic Bézier through control1 and control2 to end.

public static OutlineSegment Cubic(Vector2 control1, Vector2 control2, Vector2 end)

Parameters

control1 Vector2
control2 Vector2
end Vector2

Returns

OutlineSegment

Line(Vector2)

A straight line to end.

public static OutlineSegment Line(Vector2 end)

Parameters

end Vector2

Returns

OutlineSegment

Quadratic(Vector2, Vector2)

A quadratic Bézier through control to end.

public static OutlineSegment Quadratic(Vector2 control, Vector2 end)

Parameters

control Vector2
end Vector2

Returns

OutlineSegment