Typophile

Python/Robofab - Copy to composites

RachelR

Is it possible to use python or Robofab to replicate Fontlabs ’copy to composites’ command ?

I know I could use something like this to update sidebearings of glyphs.


from robofab.world import CurrentFont
f = CurrentFont()
#
E = ['Emacron','Ebreve','Edotaccent','Eogonek','Ecaron','Egrave','Eacute','Ecircumflex','Edieresis']
#
for glyphName in E:
f[glyphName].leftMargin = f['E'].leftMargin
f[glyphName].rightMargin = f['E'].rightMargin
#
f.update()
#
print "E composites updated"

This works fine until I get to the situation where the accents of glyphs over hang the sidebearing of the base glyph, this is where I would use the ’copy to composites’ command or the measurement line.

Using ’copy to composites’ is fine if not time consuming, but I have decomposed the composites in the process of generating the intermediate weight from a MM font. If I could write one macro that ensured all glyphs had the correct sidebearing it would save me loads of time.

Rr

I recommend that you set up metric classes in the Classes panel and then use Tools / Metrics Assistance.

Adam

Captured from web.archive.org on 12 Oct 2008. view this capture