RPoint

class RPoint()

A point object. This object is almost always created with BaseContour.appendPoint, the pen returned by BaseGlyph.getPen or the point pen returned by BaseGLyph.getPointPen. An orphan point can be created like this

point = RPoint()

labels

Labels for the points.

asDefcon()

Return the defcon object.

asFontParts()

Return a fontParts object

clearLabels()

updateSelection(sender)

Update the selection.

Inherits from subclass: fontParts.fontshell.point.RPoint

contour

The point’s parent BaseContour.

copyAttributes

font

The point’s parent BaseFont.

glyph

The point’s parent BaseGlyph.

index

The index of the point within the ordered list of the parent glyph’s point. This attribute is read only.

point.index
0

layer

The point’s parent BaseLayer.

name

The name of the point. This will be a string or None.

point.name
'my point'
point.name = None

smooth

A bool indicating if the point is smooth or not.

point.smooth
False
point.smooth = True

type

The point type defined with a string. The possible types are:

   
move An on-curve move to.
line An on-curve line to.
curve An on-curve cubic curve to.
qcurve An on-curve quadratic curve to.
offcurve An off-curve.

x

The x coordinate of the point. It must be an integer/float.

point.x
100
point.x = 101

y

The y coordinate of the point. It must be an integer/float.

point.y
100
point.y = 101

position

The point position.

selected

The object’s selection state.

obj.selected
False
obj.selected = True

identifier

The unique identifier for the object. This value will be an identifier or a None. This attribute is read only.

object.identifier
'ILHGJlygfds'

To request an identifier if it does not exist use object.getIdentifier()

changed()

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

obj.changed()

naked()

round()

Round the point’s coordinate.

point.round()

This applies to the following:

  • x
  • y

copyData(source)

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

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).

getIdentifier()

Create a new, unique identifier for and assign it to the object. If the object already has an identifier, the existing one should be returned.

generateIdentifier()

getParent()

setChanged()

update()

move(*args, **kwargs)

rotate(*args, **kwargs)

scale(*args, **kwargs)

skew(*args, **kwargs)

transform(*args, **kwargs)

translate(*args, **kwargs)

select(state=True)

setParent(parent)

Last edited on 28/10/2024