RoboFab Glyph Extras

class RGlyph
addGuide((x, y), angle, name="")

adds a guide at point x, y with angle and name returning the created guide

removeGuide(guide)

will remove the guide from the glyph

addImage(path, offset=None)

adds an image from path with offset returning the created guide

clearImage()

remove the image

removeOverlap()

removes all overlaps in every glyphs

extremePoints()

adds extremes points for every glyph

deselect()

deselect everything

getLayer(layerName, clear=True)

return the glyph for that layer, create a layer new layer if the layerName doesn’t exists

copyToLayer(layerName, clear=True)

copy the current layer to the a layer with the layerName

swapToLayer(layerName)

swap current layer with the a layer with the layerName

flipLayers(layer1Name, layer2Name)

flip layers

update()

tell the UI that the glyph has changed directly

addObserver(observer, methodName, notification)

adds an observer to the glyph that notifies the methodName of the observer for a given notification

removeObserver(observer, notification)

removes the observer for the glyph for a given notification

angledLeftMargin

returns the angled left margin based on the italic angle in the font.info

angledRightMargin

returns the angled right margin based on the italic angle in the font.info

mark

a tuple of 4 (r, g, b, a)

image

the image object, if no image is set it will be None

guides

a list of all the guides in the glyph

selection

a list of selected points

selected

returning True or False if yhe object is selected or not

Boolean Glyph

glyph | otherGlyph

returns the union of the contours

glyph % otherGlyph

returns the difference of the glyph contours

glyph & otherGlyph

returns the intersection of the glyph contours

glyph ^ otherGlyph

returns the xor of the glyph contours