I'm working on a Latin font (in FontLab 7) with contextual alternates and positional forms (programmed in the calt feature). They're all functioning and I'm thrilled (shout out to Simon Cozens, thanks for great advice
https://typedrawers.com/discussion/3818/cycling-through-positional-alternates) but I don't know how to proceed with programming the stylistic sets for these alternates.
The basic intention: ss01 would be super long ascenders, ss02 long ascenders with a particular type of flourish (eg swirly), ss03 a different type of flourish etc (eg fragmented).
The tricky part: getting the stylistic set substitutions to apply to the contextual alternates and positional forms.
An example of how the type currently automatically functions: betrayed by blobs is automatically substituted by: b.init e t r a y e d.fina space b.init y.fina space b.init l.calt o b s.falt
The problem: Although the mid-word b glyph is substituted when the ss01 feature is turned on ( b.ss01 ), unfortunately the b.init won't substitute to the corresponding ss01 glyph. Neither will the d.fina or l.calt.
The corresponding alternates are currently named b.init.ss01 (or b.ss01.init ). It's not great, but it's kept me organised while I've drawn them.
I hope this makes for an interesting question (I hope I've described it well enough). It'd be fantastic to hear any ideas on how to solve this coding challenge. Thank you for looking!
Comments
So there are two ways to achieve what you want to do, depending on the order of the lookups.
a) Process the calt substitutions first, so
b -> b.init
and then process the ss01 substitutions
b -> b.ss01
b.init -> b.init.ss01
b) Process the sso1 substitutions first, so
b -> b.ss01
and then process the calt substitutions
b -> b.init
b -> b.ss01.init
[It is helpful, but not necessary, to arrange the suffixes in the glyph names to remind you of the order in which you intend to process them.]
If you substitutions are not working as intended, it is probably because the output from your first lookups is not coded as input for the second lookups.
but FontLab doesn't like it... When I click 'update', it just deletes the new line of coding. Have I misunderstood something?
# write custom code here
#> feature
sub f i by f_i;
sub f j by f_j;
sub f l by f_l;
#< feature
# or here
} liga;