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.

    <code>exclamdown @lc_alpha;
    }script latn {<br>&nbsp; feature StandardLigatures1;<br>}<br><br>class @th_num [zero four five six seven eight nine];<br>class @lc_alpha [a-z];<br><br>feature StandardLigatures1 liga {<br>&nbsp; lookup ChainingContext2;<br>}<br><br>lookup ChainingContext2 {<br>&nbsp; context (@th_num) @lc_alpha;<br>&nbsp; sub 0 MultipleSubstitution6;<br>}<br><br>lookup MultipleSubstitution6 {<br>&nbsp; sub @lc_alpha ->



  • Paul MillerPaul Miller Posts: 271
    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: 905
    In Adobe FDK syntax, it is as simple as this:
    feature ordn {<br>    @th_nums = [zero four five six seven eight nine];<br>    sub @th_nums t' h' by t_h.ordn;<br>} ordn;

  • Paul MillerPaul Miller Posts: 271
    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.