Missing advance width in smart component

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.

The n has automatic alignment (both components green), but Glyphs completely ignores width of the second 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?

Yes, smart components work just like regular components in this regard.

The tutorial needs to be updated, you are right.

1 Like

Coolio.

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.

I found it’s not possible to add widths, in this case if it would be possible to make the metrics so they make sense when adding them together

=_part.stem + _part.arch

Can you explain what you mean? The method I described above does add width.

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

Can you post a screenshot of how your layers and anchors are set up? Or send me the file here as a private message.

what

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.

I just mentioned that:

  • setting width to =A+B doesn’t work in glyphs
  • 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.