Roman and italic different glyph count

Is there a recommendation for the following . . .

I have a 3 additional glyph variants in an italic font. All the other glyphs are present in the Roman. The glyphOrder lists the 3 additional glyphs in the middle of the glyph list so they appear in a glyph palette in an approporate/logical location.

Problem is that if non-unicode glyphs are added via the glyph palette (so not styled via OT features) and then the style is changed from Roman to Italic the glyphs swap to a different glyph.

The solution is to place the 3 additional glyph variants at the end of the glyphOrder or to add 3 ‘notdef’ glyph to match in the Roman. Or use PUA unicode I guess.

Is there a preferred route?

Implementations of glyph palettes may change. And you have no influence from within the font, really. Any hack you do now may be obsolete next year, and you will get people complaining about the hack.

What about to make four identical glyphs in Roman?

It’s not a hack. It’s always been there. In FL I used to add the additional glyphs to the end. In Corbel for MS blank Cyrillic were added in Roman to cover the additional italic glyphs.

Unfortunately this isn’t an option.

What prevents you to add the empty glyphs to the Roman font?

And especially this case that family members have slightly different glyph sets made me come up with the automatic sorting (to not rely on a fixed list).

What different order do you apply by your glyphOrder? Maybe you can use some custom sortNames on some of the glyphs to get closer to what you like?

I’ve done this and its sorted everything fine.

I reread your question. There is a better way to solve the problem. Make the unencoded glyphs accessible with an opentype feature. A one-to-many substitution in the aalt feature should work, or ssXX.