alternates in small caps

notanotherfolio's picture

Hi guys,

I'm creating a sans-serif font but as alternates the I and J have little serifs, and I want to carry over the alternates to the small caps. I'm getting a little stuck on the scripting. (Massive newbie on the scripting btw).

So when Small Caps are on with alternates the small cap serif I will be displayed instead of tthe small cap I.

Is this possible?

Thanks in advance.

agisaak's picture

Yes, it's trivially possible.

feature c2sc {
    sub [...I J...] by [];
} c2sc;

feature salt { # placed in 'salt' for access in Illustrator
    lookup alternates {
        sub [I J] by [I.alt J.alt];
    } alternates;
} salt

feature ss01 { # duplicated as a stylistic set for access in InDesign
    lookup alternates;
} ss01;


eliason's picture

Features are applied in order. So if your small caps feature comes first, make sure your stylistic alternate code changes both caps and small caps to the alternates. And if your alternate features comes first, make sure your small caps code "small-capifies" both the standard and the alternate letters.

notanotherfolio's picture

Thank you both agisaak and eliason!!

feature salt {
lookup alternates {
sub [] by [];
} alternates;

which sits after the smcp feature.


Syndicate content Syndicate content