RoboFab

Home
Download
Install
Intro
UFO
Objects
Tools
How to's
Limitations
Links
History
Glossary
Credits
Shop

See Also

Glossary: GlyphMath
RAnchor
bPoint
RComponent
RContour
RFont
RGlyph
RLib
Pen objects
RPoint
RSegment
Using Glyph Math
Using transformations

Manipulating Points

RGlyph objects have methods that allow the objects to behave a bit like variables in simple math. These methods do not do additions or substractions of the surface area of the glyphs, like layering two glyphs on top of each other and than doing "remove overlap". Instead, they return new glyph objects in which each coordinate in each contour is the product of the two glyphs.

Objects

All glyph math operations in have new, orphaned, objects as result. For instance a substraction of two FontLab RoboFab glyphs will result in a new glyph object, but it won't be part of the font. If you want the result to be part of the font you have to add it explicitly, see the example at the bottom of this page. There are several reasons for this:

If you want to add a glyph (of any flavor, FontLab or UFO) to a font use the appendGlyph method:
someNewGlyph = aFont.newGlyph("someNewGlyph")
someNewGlyph.appendGlyph(restultFromGlyphMath)

# note you have to set the width, appendGlyph does not automatically
# take the value.
someNewGlyph.width = restultFromGlyphMath.width