lookup Q_alts {
    sub Q' @NO_DESC_1 @NO_DESC_1 by Q.long;
    sub Q' @NO_DESC_1 [ @NO_DESC quoteleft quoteright ] @RIGHT_DESC  by Q.long;
    sub Q' [ g j p y ] by Q.short;
    sub Q' [ J comma semicolon parenright bracketright braceright ] by Q.low;
    sub [ Q.sc q.sc]' @SMALLCAPS by q.longsc;
} Q_alts;

# Although the following is better (shorter lists of allowed
# characters after the long f) I have to apply a more complicated 
# solution because XeTeX doesn’t like ignore sub rules
#
#lookup f_long {
#    ignore sub @DEFAULT_F' [ @NO_ASC ];
#    sub @DEFAULT_F' by @SHORT_F;
#} f_long;

lookup f_long1 {
     sub @DEFAULT_F' [ @HIGH_ASC_F @HIGH_PUNCT @ORDN @SUPS ] by @SHORT_F;
     sub @DEFAULT_F' uni200C @HIGH_ASC_F by @SHORT_F;
     sub @DEFAULT_F' @NO_ASC1 @abovediacritics by @SHORT_F;
     sub @DEFAULT_LONGS' [ @HIGH_ASC_LONGS @HIGH_PUNCT @ORDN @SUPS ] by @SHORT_LONGS;
     sub @DEFAULT_LONGS' uni200C @HIGH_ASC_LONGS by @SHORT_LONGS;
     sub @DEFAULT_LONGS' @NO_ASC1 @abovediacritics by @SHORT_LONGS;
} f_long1;

lookup f_long2 {
     sub @DEFAULT_F' uni200C @SHORT_F by @SHORT_F;
} f_long2;

lookup caltLAT {
    #sub [ space @PUNCT ] u.LAT' by u.LATinit;
    sub [ @Letters U.LAT u.LAT u.LATmedi v.LATmedi ] [ u.LAT v.LAT]' by [ u.LATmedi v.LATmedi];
} caltLAT;

lookup UC_hyphen {
    sub @LETTERS [ hyphen uni2010 uni2011 figuredash endash emdash ]' @LETTERS by [ hyphen.cap uni2010.cap uni2011.cap figuredash.cap endash.cap emdash.cap ];
} UC_hyphen;

feature calt {
    lookup Q_alts;
    lookup f_long1;
    lookup f_long2;
    lookup caltLAT;
    lookup UC_hyphen;
} calt;

lookup xtex_sub1 {
    sub X e' T e X by e.xtex2;
    sub X e' L a T e X by e.xtex2;
    sub L a' T e X by a.sc;
    sub T e' X by e.xtex1;
    sub L a.sc T e.xtex1 X [two two.lnum two.taboldstyle two.tablining] e' by e.xtex3;
} xtex_sub1;

lookup xtex_pos1 {
    pos X e.xtex2' <-130 -180 -320 0> T;
    pos X e.xtex2' <-130 -180 -200 0> L;
    pos X [two two.lnum two.taboldstyle two.tablining] e.xtex3' <0 -180 0 0>;
    pos L a.sc' <-330 210 -490 0> T e.xtex1 X;
    pos T e.xtex1' <-180 -180 -280 0> X;
}xtex_pos1;

feature xtex {
    lookup xtex_sub1;
    lookup xtex_pos1;
} xtex;
