<div>\directlua{
</div><div> fonts.handlers.otf.addfeature{</div><div>
name = "apo-nosc",</div><div>
type = "chainsubstitution",</div><div>
lookups = {</div><div>
{</div><div>
type = "substitution",</div><div>
data = {</div><div>
["quoteright.sc"] = "quoteright.fr", </div><div>
},</div><div>
},</div><div>
},</div><div>
data = {</div><div>
rules = {</div><div>
{</div><div>
before = { { "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"} },</div><div>
current = { { "quoteright.sc" } },</div><div>
lookups = { 1 },</div><div>
},</div><div>
},</div><div>
},</div><div>
}</div><div>
}</div>
When I write, for example, < \textsc{l'albero L'Albero} >, the first apostrophe is correctly rendered with the low apostrophe, that is with quoteright.sc. In the second case, the replacement rule for Luatex that I set replaces quoteright.sc with the high apostrophe, that is quoteright because the apostrophe is still between two capitals:
Comments
I managed to build a Contextual Alternates lookup that refers to a Single Substitution lookup: it works fine. The second solution is actually simpler. Is there reason to prefer one or the other, or are they equivalent?