RSegment

class RSegment()

changed()

Tell the environment that something has changed in the object. The behavior of this method will vary from environment to environment.

obj.changed()

updateSelection(sender)

Update the selection.

Inherits from subclass: fontParts.fontshell.segment.RSegment

contour

The segment’s parent contour.

font

The segment’s parent font.

glyph

The segment’s parent glyph.

index

The index of the segment within the ordered list of the parent contour’s segments.

layer

The segment’s parent layer.

offCurve

The off curve points in the segment.

onCurve

The on curve point in the segment.

points

A list of points in the segment.

smooth

Boolean indicating if the segment is smooth or not.

type

The segment type. The possible types are move, line, curve, qcurve.

copyAttributes

selected

The object’s selection state.

>>> obj.selected
False
>>> obj.selected = True

isCompatible(other)

Evaluate interpolation compatibility with other.

>>> compatible, report = self.isCompatible(otherSegment)
>>> compatible
False
>>> compatible
[Fatal] Segment: [0] + [0]
[Fatal] Segment: [0] is line | [0] is move
[Fatal] Segment: [1] + [1]
[Fatal] Segment: [1] is line | [1] is qcurve

This will return a bool indicating if the segment is compatible for interpolation with other and a string of compatibility notes.

round()

Round coordinates in all points.

copyData(source)

Subclasses may override this method. If so, they should call the super.

naked()

Return the environment’s native object that has been wrapped by this object.

>>> loweLevelObj = obj.naked()

moveBy(value)

Move the object.

>>> obj.moveBy((10, 0))

value must be an iterable containing two integer/float values defining the x and y values to move the object by.

rotateBy(value, origin=None)

Rotate the object.

>>> obj.rotateBy(45)
>>> obj.rotateBy(45, origin=(500, 500))

value must be a integer/float values defining the angle to rotate the object by. origin defines the point at with the rotation should originate. It must be a coordinate or None. The default is (0, 0).

scaleBy(value, origin=None)

Scale the object.

>>> obj.scaleBy(2.0)
>>> obj.scaleBy((0.5, 2.0), origin=(500, 500))

value must be an iterable containing two integer/float values defining the x and y values to scale the object by. origin defines the point at with the scale should originate. It must be a coordinate or None. The default is (0, 0).

skewBy(value, origin=None)

Skew the object.

>>> obj.skewBy(11)
>>> obj.skewBy((25, 10), origin=(500, 500))

value must be rone of the following:

  • single integer/float indicating the value to skew the x direction by.
  • iterable cointaining type integer/float defining the values to skew the x and y directions by.

origin defines the point at with the skew should originate. It must be a coordinate or None. The default is (0, 0).

transformBy(matrix, origin=None)

Transform the object.

>>> obj.transformBy((0.5, 0, 0, 2.0, 10, 0))
>>> obj.transformBy((0.5, 0, 0, 2.0, 10, 0), origin=(500, 500))

matrix must be a transformation. origin defines the point at with the transformation should originate. It must be a coordinate or None. The default is (0, 0).

getParent()

setChanged()

update()

move(*args, **kwargs)

rotate(*args, **kwargs)

scale(*args, **kwargs)

skew(*args, **kwargs)

transform(*args, **kwargs)

translate(*args, **kwargs)

insertPoint(point)

removePoint(point)

setParent(parent)

Last edited on 18/03/2024