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 [...I.sc J.sc...];
} c2sc;

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

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

André

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 [I.sc J.sc Igrave.sc Iacute.sc Icircumflex.sc Idieresis.sc] by [I.salt.sc J.salt.sc Igrave.salt.sc Iacute.salt.sc Icircumflex.salt.sc Idieresis.salt.sc];
} alternates;
...
}salt;

which sits after the smcp feature.

Legends!

Syndicate content Syndicate content