1

Adding the line \emph{sty} to the answer in Accessing Junicode ligatures produces a fatal error.

\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
\emph{sty}
\end{document}

The problem seems to be that the glyph t_y does not exist in the italic part of the font. What to do?

Toothrot
  • 3,346

1 Answers1

3

The glyph t_y does exist in the italic, but in its Private Use Area. Because of the way the glyph is named, you need separate definitions for the upright and the italic ligature:

\documentclass{article}
\usepackage{fontspec,filecontents}
\begin{filecontents*}{junicode.fea}
languagesystem DFLT dflt;
languagesystem latn dflt;

# upright ligatures
feature ulig {
  sub \t \y  by \t_y;
} ulig;

# italic ligatures
feature ilig {
  sub \t \y  by \uniEEDB;
} ilig;
\end{filecontents*}
\setmainfont{Junicode}[
  FeatureFile={junicode.fea},
  UprightFeatures={RawFeature=+ulig},
  ItalicFeatures={RawFeature=+ilig}]
\begin{document}
fifty
nifty
activity
\emph{sty}
\end{document}
Thérèse
  • 12,679
  • Thanks! may I ask why you prefix glyphnames with \? it seems to work without that too. – Toothrot Mar 31 '16 at 01:14
  • 1
    The slash (I assume you’re referring to that, though Markdown swallowed it up) is required in some cases (see https://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html#2.f), and it seems never to hurt, so I’ve adopted the habit of using it all the time. That’s what FontForge does too if you export a feature file from a font. – Thérèse Mar 31 '16 at 01:27