I have converted a design to use smart glyphs, but I can’t get the correct advance width in the composite glyphs. One example is the ‘n’ which is built from a stem and a second stroke. The composite ‘n’ glyph is only as wide as the stem smart component.
This is expected, as components attach just like they would using mark attachment (and thus not contribute to the advance width of the base glyph).
Use #entry and #exit anchors instead:
(Also, using the “entry” and “exit” names instead of a generic “connect” allows you to chain components. For example, add both an #entry and #exit anchor to _smart.n-second-stroke and now you can create an m from a stem and two consecutive acres.)
Yes I see that the sidebearings have very unfortunately been removed from the illustrations in the learn article Reusing shapes: smart components | Glyphs I would put what you just told me into the article.
So can I use #exit and #entry instead of connect/_connect and still have the glyphs be smart?
Beware: if you want to use multiple connect anchors (connect_2 etc., if you want to attach a shoulder or bowl in different locations for the same stem), then connect won’t work. This is due to some special case that Georg also couldn’t remember when he explained it to me. Use Connect with a capital C instead, in that case.
doesn’t work for me.
If the anchors were aligned on the edge of the drawing, then n = stem width + arc width adds to the desired width. But adjusting the side bearings can achieve the same result as well
Could you post a screenshot of your layers in Glyphs so I can see how you have placed your anchors and how they are named. Alternatively, you can send me your Glyphs file and I will have a look at why the method described above does not work in your case.
but it doesn’t need to (but I would find it useful in other cases too), because one can disable automatic alignment in the main component and then set lsb and rsb. Then the setup of the OP would work
I’m not sure why you would want to use metrics key calculations like that when the components snap together to the right width automatically. The setup of OP does work, it’s just that the anchor names were not the right ones.