After setting a new sidebearing (left of right) for an accent with Robofab (tildecomb, for example) the component change alignment in other glyphs (ntilde, Ntilde, atilde, etc), as the attached image shows.
The code is very simple.
f=CurrentFont()
g=CurrentGlyph()
g.leftMargin=0
f.update()
This doesn't happen changing width attribute, but it does changing leftMargin or rightMargin.
Any ideas why this is happening?
0
Comments
If you shift the position of an accent glyph outline relative to its origin, then that shift will be reflected by all components that reference that glyph.
Changing leftMargin shifts the position relative to the origin. Changing rightMargin without a corresponding change to the width shifts the position relative to the origin. Changing the width itself alone does not change the position relative to the origin.
If you’re going to script adjustments to sidebearings of accents that are referenced by components, then you need to include a routine to loop through your glyphs and check for any components with the relevant baseGlyph attribute and adjust its offset by a corresponding amount.
But if you’re using combining [zero-width] accents and you don’t want the components moving in your composited glyphs then why are you repositioning the accent outlines themselves in the first place?
Changing baseglyph or accent sidebearings will alter composite.
I'm working on a spacing script and I want to run it after the composites were creat Eric Van Blockland wrote me in the discussion group: This doesn't happen when you move sidebearing manually in Fontlab (dragging them in glyph window or entering new values).
So I'm trying to figure out how to change a component sidebearing from a script without alter his related composites.
I think the routine checking baseGlyphs with component offset is the best approach now.
But maybe anyone knows a different way to do this (maybe using FL python reference directly, instead of Robofab).
But basically, FL is just doing behind the scenes what I suggested above — it’s adjusting the offset of any instance of a component that references the glyph in question to compensate for the move. If you check the offsets of a component in a composite, then make an adjustment to the accent glyph, then go back and look again at the offsets, you’ll see that they changed accordingly.
That’s basically the only way I see around this, within the context of your script.
But if you’re using zero-width combining accents for all your composites and you follow the approach of having these basically centered in relation to the zero point, then you shouldn’t need to have them adjusted by a spacing script; you could just have the script ignore the zero-width glyphs.
Probably I need to spend much more time reading the documentation.
And the functionality you try to solve with this script is already build in (Filters > Transformations > Metrics).