Copy side bearings

Primary tabs

6 posts / 0 new
Last post
Hasan Abu Afash's picture
Offline
Joined: 10 Jul 2006 - 7:14am
Copy side bearings
0

Is there any Python script to copy the two side bearings and width from base glyphs to their components?

Nick Curtis's picture
Offline
Joined: 21 Apr 2005 - 8:16am
0

The only Python I'm familiar with is Monty, but you can accomplish the same task, script-free, using the "Paste Special" command.

Justin Callaghan's picture
Joined: 10 Oct 2003 - 12:49am
0

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 [[http://benkiel.com/typeDesign/|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.

Hasan Abu Afash's picture
Offline
Joined: 10 Jul 2006 - 7:14am
0

Thanks gargoyle for your comments.
But copy to composites need you to do that manually for each glyph (one after one).
The python script will let you to select all glyphs and then run it to copy to composites automatically. Hope one can write this script.

Justin Callaghan's picture
Joined: 10 Oct 2003 - 12:49am
0

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:
[[http://typophile.com/node/50404|Python/Robofab - Copy to composites]]
[[http://typophile.com/node/40232|Macro - Copy to Composites]]

Hasan Abu Afash's picture
Offline
Joined: 10 Jul 2006 - 7:14am
0

The links aren't help for Arabic glyphs because there are dots and accents nearly above every glyph.