I’m using layer.intersectionsBetweenPoints() to find the intersection point between an horizontal line and the layer’s paths, using components=True to measure components.
How can I know which component is found at a specific intersection coordinate?
Hello Georg,
I’m using the stems coordinates to set the sidebearing ignoring serifs.
For component-based glyphs (such as n/m if there are different components for stem and shoulders, o i/j), i’d like to set the sidebearings directly on the components.
Right now I disable automatic alignment on the first component and set the SB on the composed glyph, but in this way its components get out of sync… I’d like a cleaner approach if possible.
I don’t understand. Can you show how you composed your n, for example?
Use a _stem.x component and a _shoulder component. Connect them with #entry and #exit anchors. That way, you can leave automatic alignment on and set the side bearings in your stem/shoulder components.
What I’d like to do is to set the sidebearings in a general way: I could set LSB on the first component and RSB on the last. This would work for n/m, but not for i for example: i don’t want to set sidebearings on dotaccent.
So, to know which components to target, shouldn’t I know which one touches the line
as first and last? Then again, it’s very possible that I’m overthinking and I should simply say “If you’re going to use components, build your glyphs according to this specific way.”
Ok, now I feel stupid
I can set the same LSB and RSB on every component, since (obviously) it’s the anchors that define the components position! Which I guess is what @SCarewe was just saying, it’s just that I’m a bit slow!