How does Glyph decide when to use precomposed combined marks?

When you use Create Composite to generate glyphs with multiple diacritics, Glyphs sometimes recognises if you have a precomposed glyph for the required combination, and sometimes doesn’t.

For example, if you have a circumflexcomb_acutecomb glyph (for Vietnamese), generating acircumflexacute will use that as a component, rather than adding a circumflexcomb component and an acutecomb component separately.

But even if you have an acutecomb_dotaccentcomb glyph, generating sacutedotaccent will result in separate acutecomb and dotaccentcomb components.

The decomposition information for acircumflexacute and sacutedotaccent in GlyphsData.xml show no differences: a, circumflexcomb, acutecomb and s, acutecomb, dotaccentcomb, respectively. a includes circumflexcomb_acutecomb in the marks attribute, while s doesn’t have any combined marks, but adding acutecomb_dotaccentcomb to s makes no difference (and that attribute is mainly just for mark clouds anyway).

How exactly does Glyph determine whether to use precomposed diacritic combinations if they exist in the font?

Works for me. Can you send me the file?

Oh, hadn’t considered that it might be the file – it does seem to work in a different file.

Investigating closer, it turns out in one master, I’d accidentally named the combined mark glyph dotaccentcomb_acutecomb instead of acutecomb_dotaccentcomb (but acutecomb_dotaccentcomb.case was correctly named), and in the other I only had the .case variant (correctly named).

Once I fixed the name in the first master and added the non-case variant in the second, it worked in one of the two files where it didn’t work yesterday. In the other file, it now works for the lowercase (and small-caps) sacutedotaccent, but not for the uppercase Sacutedotaccent.

I’ll DM you a minimised version of the file where it doesn’t work for the uppercase.

It seems you need acutecomb.case, dotaccentcomb.case and acutecomb_dotaccentcomb.case. I see if I can improve this.

Hmm… there’s no acutecomb.case or dotaccentcomb.case in the font where it works, though there is an acutecomb.sc and a dotaccentcomb.sc.

In the font where the uppercase doesn’t work, there are no .sc variants either, so I guess somehow having .sc variants triggers the same thing that .case variants do and makes it work?

It fails when only one of the two accents has a .case variant. So it is fine with no .case variants or if both have it.

Oh, I see! Yes, that is indeed the case in the font where it doesn’t work: acutecomb has a case variant, dotaccentcomb doesn’t.

Well, that’s an easy fix, at least – works perfectly now!