Typophile

Macro - Copy to Composites

RachelR

Hi all,

I’m to write a script to use with RoboFab that will work like the fontlab function “Copy to composites” from the preview window when a glyph is used in other composites.

This fiunction works fine but I was trying to produce something that would update all the metrics in composites in on go without having to go through each glyph.

I thought something like this might work,

#---------------------------
#UPDATE COMPONENT METRICS
#---------------------------
from robofab.world import CurrentFont
f = CurrentFont()

f['Itilde'].leftMargin = f['I'].leftMargin
f['Imacron'].leftMargin = f['I'].leftMargin
f['Ibreve'].leftMargin = f['I'].leftMargin
f['Iacute'].leftMargin = f['I'].leftMargin
f['Icircumflex'].leftMargin = f['I'].leftMargin
f['Idieresis'].leftMargin = f['I'].leftMargin
f['Igrave'].leftMargin = f['I'].leftMargin
f['Idotaccent'].leftMargin = f['I'].leftMargin
f['Itilde'].rightMargin = f['I'].rightMargin
f['Imacron'].rightMargin = f['I'].rightMargin
f['Ibreve'].rightMargin = f['I'].rightMargin
f['Iacute'].rightMargin = f['I'].rightMargin
f['Icircumflex'].rightMargin = f['I'].rightMargin
f['Idieresis'].rightMargin = f['I'].rightMargin
f['Igrave'].rightMargin = f['I'].rightMargin
f['Idotaccent'].rightMargin = f['I'].rightMargin

f.update()

This produces sidebearings including the added accents in the case of the Itilde, Imacron etc.

When using the Copy to Composites function in FL it produ

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