RGuideline

class RGuideline()

A guideline object. This object is almost always created with BaseGlyph.appendGuideline. An orphan guideline can be created like this:

>>> guideline = RGuideline()

magnetic

Number indicating how magnetic a guide is.

showMeasurements

Bool indicating if the guideline should show measurements.

Inherits from subclass: fontParts.fontshell.guideline.RGuideline

angle

The angle of the guideline. It must be an angle. Please check how :func:normalizers.normalizeRotationAngle handles the angle. There is a special case, when angle is None. If so, when x and y are not 0, the angle will be 0. If x is 0 but y is not, the angle will be 0. If y is 0 and x is not, the angle will be 90. If both x and y are 0, the angle will be 0. :

>>> guideline.angle
45.0
>>> guideline.angle = 90

color

” The guideline’s color. This will be a color or None. :

>>> guideline.color
None
>>> guideline.color = (1, 0, 0, 0.5)

copyAttributes

font

The guideline’s parent BaseFont.

glyph

The guideline’s parent BaseGlyph.

index

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

>>> guideline.index
0

name

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

>>> guideline.name
'my guideline'
>>> guideline.name = None

x

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

>>> guideline.x
100
>>> guideline.x = 101

y

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

>>> guideline.y
100
>>> guideline.y = 101

position

The point position.

selected

The object’s selection state.

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

naked()

isCompatible(other)

Evaluate interpolation compatibility with other. :

>>> compatible, report = self.isCompatible(otherGuideline)
>>> compatible
True
>>> compatible
[Warning] Guideline: "xheight" + "cap_height"
[Warning] Guideline: "xheight" has name xheight | "cap_height" has
                      name cap_height

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

round()

Round the guideline’s coordinate.

>>> guideline.round()

This applies to the following:

  • x
  • y

It does not apply to

  • angle

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

copyData(source)

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

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.

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

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

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

generateIdentifier()

getParent()

setChanged()

update()

move(*args, **kwargs)

rotate(*args, **kwargs)

scale(*args, **kwargs)

skew(*args, **kwargs)

transform(*args, **kwargs)

translate(*args, **kwargs)

setParent(parent)

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.

Last edited on 19/11/2018