Is there any Python script to copy the two side bearings and width from base glyphs to their components?
FontLab's Metrics panel also has a feature to do this— while in Metrics mode, there's a down-arrow underneath the active glyph which reveals a menu with "Copy to composites." If the glyph has composites, a dialog will appear lettering you choose which ones to change. And if you're using metrics classes (or wish to take the time to create them), the Metrics Assistance tool could further automate the process.
For python scripting, you might find some useful ideas in a couple of of Ben Kiel's scripts. Robofab seems to provide more direct access to sidebearings (via the leftMargin and rightMargin attributes of the RGlyph object) than FontLab's native API.
While "Paste Special" and "Copy to composites" must me done for every individual base glyph, the Metrics Assistance tool does allow for multiple groups to be updated at once (after a bit of tedious box-checking). But you do have to create the metrics classes first.
Some previous discussions about replicating "Copy to composites" with Robofab:
Python/Robofab - Copy to composites
Macro - Copy to Composites
Captured from commoncrawl.org on 26 Apr 2015. original URL