How to make a contextual cursive font

[UPDATE February 6, 2016] The approach is this post is not recommended as both init and fina features are not meant for Latin based text. An interesting topic about these features includes a proposal from John Hudson (“These features turned out to work almost exactly not as described, either in layout engines or in fonts.”) which might clear things up in the future. Later posts to this topic do show a better way of implementing contextual cursive fonts.

*Just add the high tail versions to the hightail class, so it looks like:

class @hightail [b.normal o.normal r.normal v.normal w.normal b.high o.high r.high v.high w.high];
*

*There are specific features (Initial Form and Terminal Form) for this task, but not all software support these. I think Adobe Indesign and Recent versions of Word do support them.

The script below should get you started:
*

script latn {
  feature InitialForms1;
  feature TerminalForms1;
  feature ContextualAlternates;
}

class @hightail [b o r v w b.high o.high r.high v.high w.high];
class @lowercase [a b c d e f g h i j k l m n o p q r s t u v w x y z];
class @lowercaseaht [a.high b.high c.high d.high e.high f.high g.high h.high i.high j.high k.high l.high m.high n.high o.high p.high q.high r.high s.high t.high u.high v.high w.high x.high y.high z.high];
class @lowercaseinit [a.init b.init c.init];
class @lowercaseterm [a.term b.term c.term];

feature ContextualAlternates calt {
  lookup ChainingContextHighTail;
}

feature InitialForms1 init {
  lookup SingleSubstitution1;
}

feature TerminalForms1 fina {
  lookup SingleSubstitution2;
}

lookup ChainingContextHighTail {
  context (@hightail) @lowercase;
  sub 0 SingleSubstitutionHighTail;
}

lookup SingleSubstitution1 {
  sub @lowercase -> @lowercaseinit;
}

lookup SingleSubstitution2 {
  sub @lowercase -> @lowercaseterm;
}

lookup SingleSubstitutionHighTail {
  sub @lowercase -> @lowercaseaht;
}

Please let us know your results, if possible with some work-in-progress screenshots!