1

I am making a document using the font Minion Pro, which lacks an 'oo' ligature (ie U+A74F: ꝏ). I would like to therefore artificially create this ligature by automatically reducing the spacing between any occurrence of the letter pair 'oo'. I can do this manually and create a command (eg \oo), but that would be quite annoying compared to the ease of other ligatures.

Below is the effect I'd like, albeit cumbersomely created:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Minion Pro}

\begin{document}
    \Huge
    Bo\hspace{-.15em}ok\par Book
\end{document}

enter image description here

Thérèse
  • 12,679

3 Answers3

3

Here, I make o active, which you don't want in general, so I provide \myligON and \myligOFF to bound its use.

\documentclass{article}
\let\svO o
\newcommand\OOkern{\hspace{-.15em}}
\newcommand\myligON{\catcode`o=\active }
\newcommand\myligOFF{\catcode`o=11 }
{\catcode`o=\active \gdefo#1{\svO\ifxo#1\expandafter\OOkern\fi#1}}
\begin{document}
Book

\myligON Book hop \myligOFF
versus Book hop

\end{document}

enter image description here

2

I wouldn’t do this everywhere, only for special effect in titles at display size. But the method of kerning Ulrike Fischer explains at How to adjust font features in LuaTeX? does the job:

% compile with lualatex
\documentclass{article}
\usepackage{fontspec}
\directlua{
 fonts.handlers.otf.addfeature{
   name = "oooh",
   type = "kern",
   data =
   {
     ["o"] = { ["o"] =  -175 },
   },
 }
}
\setmainfont{Minion Pro}[RawFeature=+oooh]
\begin{document}
Look at the old book in the nook.
\end{document}

output

Thérèse
  • 12,679
2

A XeTeX solution to complement @Therese's LuaTeX answer, making use of the Interchartoks feature:

\documentclass{article}
\XeTeXinterchartokenstate = 1
\newXeTeXintercharclass \mycharclasso
\XeTeXcharclass `\o \mycharclasso
% between "o" and "o":
\XeTeXinterchartoks\mycharclasso\mycharclasso={\kern-2.5pt }
\usepackage{fontspec}
\setmainfont{Minion Pro}
\begin{document}
    \huge\centering Look at the old book in the nook.
\end{document}

ligatured text