Subbing Contextual Alternates Issues

Hello

Im having some issues with Subbing contextual alternates

Here is the code im working with

# r by f
sub r f’ by f.calt;
sub r f_b.liga’ by f_b.liga.calt;
sub r f_f.liga’ by f_f.liga.calt;
sub r f_i.liga’ by f_i.liga.calt;
sub r f_f_i.liga’ by f_f_i.liga.calt;
sub r f_h.liga’ by f_h.liga.calt;
sub r f_k.liga’ by f_k.liga.calt;
sub r f_l.liga’ by f_l.liga.calt;
sub r f_u.liga’ by f_u.liga.calt;
sub r f_y.liga’ by f_y.liga.calt;
sub r f_t.liga’ by f_t.liga.calt;
sub r f_t_y.liga’ by r f_t_y.liga.calt;

At the moment I am essentially subbing out any f/t based ligatures with a .calt version with no cross bar on the left (to resolve some spacing issues) when its precede by an r

At the moment its fine, but i would like to sub the current r with a more condensed version (to resolve more spacing issues)

So this:
sub r f_b.liga’ by f_b.liga.calt;
Becomes this:
sub r f_b.liga’ by r.narrow f_b.liga.calt;

But this result doubles the r’s instead of subbing the original out with the r.narrow version
So sterfbed becomes sterrfbed

Does anyone have a work around? Or know how to sub out the r.narrow with the original?

Thanks very much

You are replacing the f_b.liga by an r.narrow + f_b.liga.calt. That is a one to many substitution.

after you did all the liga.calt subs, do one like this:

lookup r_narrow {
    sub r' [f_b.liga.calt f_f.liga.calt f_i.liga.calt …] by r.narrow;
} r_narrow;

You

ahhh okay, makes sence

Works like a charm

Thanks, Georg!