Extending the 20 Stylistic sets OpenType limitation

A couple of questions:

  1. Is there a more or less easy way to add more than 20 stylistic alternates to a single letter in a way that they would show up in Photoshop/Illustrator’s Alternates for Current Selection list (Glyphs panel). Can I use .altXX suffix and then use a lookup rule or something? If yes, what feature would be the best for the code to appear within?
  2. Can I add alternates to .fina and .init glyphs? like .fina02 .init03? Would they appear in the Alternates for Current Selection list?

This sounds like a perfect fit for Character Variants features (cv01-cv99). You’d add all alternates for a letter (incl. related letters) in one feature like this:

sub a from [a.alt1 a.alt2 a.alt3 a.alt4];
sub aacute from [aacute.alt1 aacute.alt2 aacute.alt3 aacute.alt4];


I think the Glyphs panel in Adobe apps will offer them, but not 100% sure.

1 Like

If you place the cv## code after the init/fina code, you can change those, too. So:

sub a.fina by a.fina.alt;


sub a.fina from [a.fina2, a.fina3, ...];
1 Like

Thanks so much guys! :heart:

I’ve tried both ways: adding cvXX glyphs - they do appear in the Alternate Glyphs list in the Glyphs panel and adding the “sub xxx from [xxx]” rule to the salt feature - works as well.

What would be the best practice - adding cvXX glyphs or creating “sub xxx from xxx” rule using .altXX suffixes?

That depends on whether you have multiple alternatives for a glyphs or not. Character variants are designed to collect all variants of a glyph in one feature.

So this is correct:

# cv01:
sub a by a.alt;
# cv02:
sub b by b.alt;

and this is correct:

# cv01:
sub a from [a.alt1 a.alt2 a.alt3];
# cv02:
sub b from [b.alt1 b.alt2 b.alt3];

but this is against the cv## spirit:

# cv01:
sub a by a.alt1;
# cv02:
sub a by a.alt2;
1 Like

Makes sense.
What feature the code belongs to?
Can I create a lookup (if lookup needs to be created at all) in, lets say, salt feature and keep all my alternate letters there in “sub from” rules? Do I actually need the cvXX feature at all?

The ones indicates with the # comment above. So

# cv01:
sub a by a.alt;
# cv02:
sub b by b.alt;


Feature cv01 code:

sub a by a.alt;

Feature cv02 code:

sub b by b.alt;

I don’t have Adobe’s apps to test, so try it if you have a CC subscription or ask your client to test in their application.

Thanks Florian! Adding sub/from in salt feature works well so I’ll stick to this option for now.

Alternatively, I’d create glyphs with .cvxx suffixes the same way as we create stylistic alternates - .ssxx glyphs. Then the CVXX feature would be added automatically and work just the way SSXX features work, I guess?

What confused me was that you’ve used separate cvXX features for different letters - cv01 for a and cv02 for b.

A single character variant (for example, cv01) enumerates all variants of that glyph. So if you have 3 alternative variants of a, they all go into the same feature:


sub a from [a.alt1 a.alt2 a.alt3];

The b might only have two variants:


sub b from [b.alt1 b.alt2];

And the c might have hundreds of variants:


sub c from [c.alt1 c.alt2 ... c.alt156];

This is a UI how such character variants would be used:

Some (like cv03) are a checkbox since there is only one variant. Some (like cv04) offer multiple choices (04/0, 04/1, 04/2, 04/3, 04/4).

Yes yes, I do understand that :slight_smile:
Why they can’t all be a part of a single cv01 or salt/ss01/calt?

sub a from [a.alt1 a.alt2 a.alt3];
sub b from [b.alt1 b.alt2];
sub c from [c.alt1 c.alt2];

OR same thing wrapped with

lookup SUB_01 {
} SUB_01;

If they are part of a single feature, how would I change only the a and not the b?

Having one feature per character allows you to change only one at a time.

1 Like

The screenshot explains why you suggest adding them in separate features. Perhaps combining letters with the same number of alternates/forms.
I’ve never seen character variants panel (shame on me) - what application is this?

In case when you select an alternate from a dropdown list or from Glyphs panel (Alternates for Selection) in Photoshop/Illustrator - I guess, keeping all sub/from in one feature would work fine.

Affinity Designer. Apple’s apps also offer such a panel. Additionally, character variants are usable on the Web with CSS and in TeX with packages such as fontspec.

I would advise against putting unrelated glyphs in a single cv##. The OpenType spec says:

Whereas the Stylistic Set features assume recurring stylistic variations that apply to a broad set of Unicode characters, these features [cv01–cv99] are intended for scenarios in which particular characters have variations not applicable to a broad set of characters. The Stylistic Alternates feature provides access to glyph variants, but does not allow an application to control these on a character-by-character basis; the Character Variant features provide the greater granularity of control.