bPoint

Description

The bPoint is a point object which mimics the old “Bezier Point” from RoboFog. It has attributes for bcpIn, anchor, bcpOut and type. The coordinates in bcpIn and bcpOut are relative to the position of the anchor. For instance, if the bcpIn is 20 units to the left of the anchor, its coordinates would be (-20,0), regardless of the coordinates of the anchor itself. Also: bcpIn will be (0,0) when it is “on top of the anchor”, i.e. when there is no bcp it will still have a value. The parent of a bPoint is usually a Contour.

Overview

Parents

BaseBPoint.contour The bPoint’s parent contour.
BaseBPoint.glyph The bPoint’s parent glyph.
BaseBPoint.layer The bPoint’s parent layer.
BaseBPoint.font The bPoint’s parent font.

Identification

BaseBPoint.index The index of the bPoint within the ordered list of the parent contour’s bPoints.

Attributes

BaseBPoint.type The bPoint type.

Points

BaseBPoint.anchor The anchor point.
BaseBPoint.bcpIn The incoming off curve.
BaseBPoint.bcpOut The outgoing off curve.

Transformations

BaseBPoint.transformBy Transform the object.
BaseBPoint.moveBy Move the object.
BaseBPoint.scaleBy Scale the object.
BaseBPoint.rotateBy Rotate the object.
BaseBPoint.skewBy Skew the object.

Normalization

BaseBPoint.round Round coordinates.

Environment

BaseBPoint.naked Return the environment’s native object that has been wrapped by this object.
BaseBPoint.changed Tell the environment that something has changed in the object.

Reference

class fontParts.base.BaseBPoint(*args, **kwargs)

Parents

BaseBPoint.contour

The bPoint’s parent contour.

BaseBPoint.glyph

The bPoint’s parent glyph.

BaseBPoint.layer

The bPoint’s parent layer.

BaseBPoint.font

The bPoint’s parent font.

Identification

BaseBPoint.index

The index of the bPoint within the ordered list of the parent contour’s bPoints. None if the bPoint does not belong to a contour.

Attributes

BaseBPoint.type

The bPoint type.

Points

BaseBPoint.anchor

The anchor point.

BaseBPoint.bcpIn

The incoming off curve.

BaseBPoint.bcpOut

The outgoing off curve.

Transformations

BaseBPoint.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 Matrix. origin defines the point at with the transformation should originate. It must be a Coordinate or None. The default is (0, 0).

BaseBPoint.moveBy(value)

Move the object.

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

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

BaseBPoint.scaleBy(value, origin=None)

Scale the object.

>>> obj.transformBy(2.0)
>>> obj.transformBy((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).

BaseBPoint.rotateBy(value, origin=None)

Rotate the object.

>>> obj.transformBy(45)
>>> obj.transformBy(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).

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

Normalization

BaseBPoint.round()

Round coordinates.

Environment

BaseBPoint.naked()

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

>>> loweLevelObj = obj.naked()
BaseBPoint.changed(*args, **kwargs)

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

>>> obj.changed()