# How to use fontspec with opentype fonts when ligatures are a separate font

I am just learning LATEX. Have been wanting to for years, doing quite well (at 60) and many years of programming are making it a joy!

I am using fontspec to load some fonts directly from a subdirectory of the tex documents directory. This works as follows:

\documentclass[]{article}
\usepackage{fontspec}
\usepackage{lipsum}
%opening
\title{A Test of Zapinfo}
\author{Ramonskovitch}

\begin{document}

\fontspec[Path = fonts/zapfino/,
]{ZapfinoExtraLT-One.otf}
\maketitle

\begin{abstract}
Ramonskovitch wanted to be a duffle
\end{abstract}

\section{The First Section}
\lipsum[1-3]
\end{document}


This works as expected. However, I can't work out though, how to get Ligatures when the ligatures are in a separate font file (in the font directory) The same question will apply to ornaments when I get to those

All help appreciated Dan Raymond

-
Welcome to TeX.SX. You might have a look to our start page: it will help you to familiarize with the site. – Claudio Fiandrino May 27 '13 at 11:35

this is only a partial answer, as it's a bit hard to work on your question without having the fonts available, particularly with a font as idiosyncratic as Zapfino.

You're saying the ligatures are in a separate font file. As far as I can tell, ZapfinoExtraLT-One.otf does include ligatures, as do the other flavours that Zapfino comes in:

...and there's no reason why they shouldn't turn up in the pdf you're creating. If, however, you want to switch between the different flavours of Zapfino -- using flavour ›One‹ as your main font, but take the ligatures from flavour ›Two‹ --, you could define different font families using \newfontfamily, and switch between them whenever you want. This may not be the fully automated solution you're looking for (»use font x, but take ligatures from font y«), but maybe it can be turned into one (not by me, though).

\documentclass{article}
\usepackage{fontspec}
\usepackage{lipsum}

\setmainfont{TeX Gyre Termes}
\newfontfamily\zapftwo{TeX Gyre Cursor}
\newcommand\textzapftwo[1]{{\zapftwo #1}}

\begin{document}
\lipsum[1-3]

di\textzapftwo{ff}erent  \textzapftwo{fi}le
\end{document}


PS: as for the ornaments, this might be helpful.

PPS: at the boundaries between two flavours, as in different, kerning might become an issue. I suppose pair kerning information is lost when switching fonts in the middle of a word, so without corrections the result might look awkward.

-
that works, thanks – ramonskovitch May 28 '13 at 11:14