Copy to Composites Macro - RoboFab ?

Primary tabs

3 posts / 0 new
Last post
ReginaldV's picture
Offline
Joined: 7 Apr 2008 - 4:13am
Copy to Composites Macro - RoboFab ?
0

Hi all,

I trying to write a macro with RoboFab that works in the same way as FL copy to composites from the metrcis window, so I can quickly copy the metrics from glyphs like "H" to the Hbar.

I was trying something like this :

#CopyToComposites
#
from robofab.world import CurrentFont
f = CurrentFont()
#
f['Hbar'].leftMargin = f['H'].leftMargin
f['Hbar'].rightMargin = f['H'].rightMargin
#
f.update()

The problem with this is it copies the actual sidebearing, so in cases like the Hbar the sidebearing is measured from the bar which overhangs the stem of the 'H', but I want it to be measured form the stem like you can do with the measuring line in the metrics window.

Miguel Sousa's picture
Offline
Joined: 18 May 2003 - 8:30pm
0

A [[http://code.robofab.com/changeset/86|pen to calculate the horizontal margins of a glyph at any given height by intersecting the shape with a horizontal line]] was recently added to Robofab, which seems to be what you need.

ReginaldV's picture
Offline
Joined: 7 Apr 2008 - 4:13am
0

So I need to copy this script into Robofab ? - where would I put the script ?