Segment¶
Must Override¶
May Override¶
- BaseSegment._getItem(index: int) BasePoint[source]¶
Get the native point at the specified index.
This is the environment implementation of
BaseSegment.__getitem__.- Parameters:
index – The zero-based index of the point to retrieve as an
int.- Returns:
The
BasePointinstance located at the specified index.- Raises:
IndexError – If the specified index is out of range.
Note
Subclasses may override this method.
- BaseSegment._get_index() int[source]¶
Get the index of the native segment.
This is the environment implementation of the
BaseSegment.indexproperty getter.- Returns:
An
intrepresenting the segment’s index within an ordered list of the parent contour’s segments, orNoneif the segment does not belong to a contour.
Note
Subclasses may override this method.
- BaseSegment._get_offCurve() tuple[BasePoint, ...][source]¶
Get the off-curve points in the native segment.
This is the environment implementation of the
BaseSegment.offCurveproperty getter.Note
Subclasses may override this method.
- BaseSegment._get_onCurve() BasePoint | None[source]¶
Get the on-curve point in the native segment.
This is the environment implementation of the
BaseSegment.onCurveproperty getter.Note
Subclasses may override this method.
- BaseSegment._get_points() tuple[BasePoint, ...][source]¶
Get a list of all points in the native segment.
This is the environment implementation of the
BaseSegment.pointsproperty getter.- Returns:
A
tupleof :class`BasePoints`.
Note
Subclasses may override this method.
- BaseSegment._get_smooth() bool[source]¶
Get the native segment’s smooth state.
This is the environment implementation of the
BaseSegment.smoothproperty getter.- Returns:
Trueif the segment is smooth,Falseif it is sharp. The value will have been normalized withnormalizers.normalizeBoolean.
Note
Subclasses may override this method.
- BaseSegment._get_type() str[source]¶
Get the native segment’s type.
This is the environment implementation of the
BaseSegment.typeproperty getter.- Returns:
A
strrepresenting the type of the segment. The value will have been normalized withnormalizers.normalizeSegmentType.
Note
Subclasses may override this method.
- BaseSegment._init(*args: Any, **kwargs: Any) None¶
Initialize the native object.
This is the environment implementation of
BaseObject.__init__.- Parameters:
*args – Any positional arguments.
**kwargs – Any keyword arguments.
Note
Subclasses may override this method.
- BaseSegment._iterPoints(**kwargs: Any) Generator[BasePoint][source]¶
Return an iterator over the points in the native segment.
This is the environment implementation of
BaseSegment.__iter__.- Returns:
An iterator over the
BasePointsubclass instances belonging to the segment.
Note
Subclasses may override this method.
- BaseSegment._len(**kwargs: Any) int[source]¶
Return the number of points in the native segment.
This is the environment implementation of
BaseSegment.__len__.Note
Subclasses may override this method.
- BaseSegment._moveBy(value: list[int | float] | tuple[int | float, int | float], **kwargs: Any) None¶
Move the native object according to the given coordinates.
This is the environment implementation of
BaseObject.moveBy.- Parameters:
value – The x and y values to move the object by as a Coordinate. The value will have been normalized with
normalizers.normalizeTransformationOffset.**kwargs – Additional keyword arguments.
Note
Subclasses may override this method.
- BaseSegment._rotateBy(value: float, origin: list[int | float] | tuple[int | float, int | float], **kwargs: Any) None¶
Rotate the native object by the specified value.
This is the environment implementation of
TransformationMixin.rotateBy.- Parameters:
value – The angle at which to rotate the object as an
intor afloat. The value will have been normalized withnormalizers.normalizeRotationAngle.origin – The point at which the rotation should originate as a Coordinate or
None. The value will have been normalized withnormalizers.normalizeCoordinateTuple.**kwargs – Additional keyword arguments.
Note
Subclasses may override this method.
- BaseSegment._scaleBy(value: list[int | float] | tuple[float, float], origin: list[int | float] | tuple[int | float, int | float], **kwargs: Any) None¶
Scale the native object according to the given values.
This is the environment implementation of
BaseObject.scaleBy.- Parameters:
value – The value to scale the glyph by as a single
intorfloat, or atupleorlistof twointorfloatvalues representing the values(x, y). The value will have been normalized withnormalizeTransformationScale.origin – The point at which the scale should originate as a Coordinate or
None. The value will have been normalized withnormalizers.normalizeCoordinateTuple.**kwargs – Additional keyword arguments.
Note
Subclasses may override this method.
- BaseSegment._set_smooth(value: bool) None[source]¶
Set the native segment’s smooth state.
This is the environment implementation of the
BaseSegment.smoothproperty setter.- Parameters:
value – The point’s smooth state as a
bool. The value will have been normalized withnormalizers.normalizeBoolean.
Note
Subclasses may override this method.
- BaseSegment._set_type(newType: str) None[source]¶
Set the native segment’s type.
This is the environment implementation of the
BaseSegment.typeproperty setter.- Parameters:
newType – The segment type definition as a
str. The value will have been normalized withnormalizers.normalizeSegmentType.- Raises:
FontPartsError – If the segment does not belong to a contour.
Note
Subclasses may override this method.
- BaseSegment._skewBy(value: list[int | float] | tuple[float, float], origin: list[int | float] | tuple[int | float, int | float], **kwargs: Any) None¶
Skew the native object by the given value.
This is the environment implementation of
TransformationMixin.skewBy.- Parameters:
value – The value by which to skew the object as either a single
intorfloatcorresponding to the x direction, or atupleof twointorfloatvalues corresponding to the x and y directions. The value will have been normalized withnormalizers.normalizeTransformationSkewAngle.origin – The point at which the rotation should originate as a Coordinate or
None. The value will have been normalized withnormalizers.normalizeCoordinateTuple.**kwargs – Additional keyword arguments.
Note
Subclasses may override this method.
- BaseSegment._transformBy(matrix: list[int | float] | tuple[float, float, float, float, float, float], **kwargs: Any)[source]¶
Transform the native object according to the given matrix.
This is the environment implementation of
TransformationMixin.transformBy.- Parameters:
matrix – The Transformation Matrix to apply. The value will have been normalized with
normalizers.normalizeTransformationMatrix.**kwargs – Additional keyword arguments.
Note
Subclasses may override this method.