5
\documentclass{article}
\usepackage{fontspec}

\setmainfont{junicode}
%\setmainfont[Ligatures=Discretionary]{junicode}

\begin{document}
fifty
nifty
activity
\end{document}

This will produce fty ligatures, but not a ty lig. in the last word.

enter image description here

Commenting out to use ‘discretionary’ ligatures will enable ty but disable fty. How can I enable both?

enter image description here

Toothrot
  • 3,346

1 Answers1

3

Use a feature file to add the ty (and other desired) ligatures to the liga feature.

\documentclass{article}
\usepackage{fontspec}
\usepackage{filecontents}

\begin{filecontents*}{junicode.fea}
languagesystem DFLT dflt;
languagesystem latn dflt;

feature liga {
    sub t y by t_y;
} liga;
\end{filecontents*}

\setmainfont[FeatureFile={junicode.fea}]{junicode}

\begin{document}
fifty
nifty
activity
\end{document}

enter image description here

Toothrot
  • 3,346
  • Ummm, this code does not provide an answer to the issue you raised in the posting. The fty ligature is in the "Common" group of ligatures, and it gets employed whether or not the feature file is loaded -- as long as "Discretionary" ligatures aren't loaded as well. If the "Discretionary" (aka "Rare") group of ligatures is loaded, the feature file approach (with sub f t y by f_t_y in the "liga" feature) does not work, and the ty ligature is employed -- whether or not the feature file is loaded. Please provide an approach that solves the issue raised in the posting itself. – Mico Mar 30 '16 at 22:26
  • @Mico, the question was how to enable both ligatures at the same time, and that q. has been answered. An alternative is probably to add f_t_y to the dlig feature. – Toothrot Mar 30 '16 at 22:35
  • I had read your original question as asking how to (re)enable the fty ligature if the Discretionary/Rare group of ligatures is activated. It would be helpful if your answer showed explicitly how this might be accomplished via a feature file approach. If, on the other hand, your question was not about discretionary ligatures, it might be helpful if you edited your posting to clarify the posting's objective. – Mico Mar 30 '16 at 22:47
  • @Mico, frankly I think I indicated with sufficient clarity that I was interested in the ligatures and not the ligature groups. The question was ‘how could I enable both [ligatures]’. If you disagree you are welcome to edit the question or give a better answer. – Toothrot Mar 30 '16 at 23:07