Noob question about Chaining Contexts

What I want to achieve is to substitute a glyph for a pair of letters, but only if it occurs after a numeral.

Can I make a Ligature substitution lookup dependent upon a chaining context ?

what I have at the moment is  --


lookup ChainingContext2 {
  context (@th_num) @lc_alpha;
  sub 0 Ligature6;
}

Where @th_num is a list of numerals (0,4,5,6,7,8,9)
@lc_alpha is a list of all lower case letters (a -> z)
and Ligature6 is the ligature substitution table I want to activate after the numerals 0,4,5,6,7,8,9.

But it doesn't work,  any ideas ?

Tagged:

Comments

  • You need a multiple substitution in order to replace a single glyph for a pair of glyphs.

    script latn {
      feature StandardLigatures1;
    }

    class @th_num [zero four five six seven eight nine];
    class @lc_alpha [a-z];

    feature StandardLigatures1 liga {
      lookup ChainingContext2;
    }

    lookup ChainingContext2 {
      context (@th_num) @lc_alpha;
      sub 0 MultipleSubstitution6;
    }

    lookup MultipleSubstitution6 {
      sub @lc_alpha ->
    exclamdown @lc_alpha;
    }



  • Paul MillerPaul Miller Posts: 59
    I actually wanted to replace two characters with a single character, thats why I thought that a Ligature substitution was appropriate.

    Sorry I didn't express myself clearly.

  • For that you must ensure you add both "characters" to the input, e.g.

    lookup ChainingContext2 {
      context (@th_num) @lc_alpha @lc_alpha;
      sub 0 Ligature6;
    }


  • Kent LewKent Lew Posts: 625
    In Adobe FDK syntax, it is as simple as this:
    feature ordn {
    @th_nums = [zero four five six seven eight nine];
    sub @th_nums t' h' by t_h.ordn;
    } ordn;

  • Paul MillerPaul Miller Posts: 59
    For that you must ensure you add both "characters" to the input, e.g.

    lookup ChainingContext2 {
      context (@th_num) @lc_alpha @lc_alpha;
      sub 0 Ligature6;
    }


    Thank you that was the problem, my Ordinals now work for st, nd, rd, th and the Spanish ordinals of o and a.

    Very helpful.  :)
Sign In or Register to comment.