RoboFab

Support RoboFab

Up

See also

RoboFab Mailinglist

Join the RoboFab users community at Google groups.

Google Groups

Email:

Visit this group

RoboFab Sponsors

RoboFab RComponent

Usage

# the easiest way to get to a component
# is to get one from a glyph
from robofab.world import CurrentFont
f = CurrentFont()
g = f['adieresis']
for c in g.components:
    print c
download examples/usageComponent.py
< RComponent for Excellent-Regular.adieresis.components[0] >
< RComponent for Excellent-Regular.adieresis.components[1] >

Description

A component can be a part of a glyph and it is a reference to another glyph in the same font. With components you can make glyphs depend on other glyphs. Changes to the baseGlyph will reflect in the component as well. Fontographer and RoboFog called them composites. The parent of a component is usually a glyph. Components can be decomposed: they replace themselves with the actual outlines from the baseGlyph. When that happens the link between the original and the component is broken: changes to the baseGlyph will no longer reflect in the glyph that had the component.

Attributes

Attribute examples

# robofab manual
#     Component object
#    attribute examples

print f['adieresis'].components[0].baseGlyph
print f['adieresis'].components[1].baseGlyph

# move the component in the base glyph
f['adieresis'].components[1].offset = (100,100)

# scale the component in the base glyph
f['adieresis'].components[0].scale = (.5, .25)
download examples/componentAttributes.py
a
dieresis

Methods

Method examples

# robofab manual
#     Component object
#    method examples

#method examples
download examples/componentMethods.py