# [OS X TeX] fontspec, disabling something.

Bruno Voisin bvoisin at mac.com
Fri May 11 19:48:36 EDT 2007

Le 12 mai 07 à 00:17, Maarten Sneep a écrit :

> I'm trying to see what is in the fontspec package and XeTeX. I've
> come across something that the manual says should work, but it
> doesn't for me. The issue is shown in the minimal sample included
> below. I see a WordFinal version of the ‘e’ at the end of
> ‘nightmare’, which I want to disable. As you can see I tried to do
> that, and while there are no errors printer to the terminal, or the
> log, the WordFinal ‘e’ is still there. Am I missing something?
>
> [...]
>
> Obligatory minimal sample:
> %%%
> \documentclass[12pt,a4paper]{article}
> \usepackage{graphicx}
>
> \usepackage{fontspec}% provides font selecting commands
> \usepackage{xunicode}% provides unicode character macros
> \usepackage{xltxtra} % provides some fixes/extras
>
> \setmainfont[Mapping=tex-text,Ligatures={Rare,Diphthong}]{Hoefler
> Text}
>
> {NoWordInitial,NoWordFinal}}}
>
> \frenchspacing
>
> \begin{document}
> I thought it was \emph{a nightmare} to begin with.
> \end{document}
> %%%

I see the same as you do, and it seems to be a bug in either XeTeX or
the font, but not in fontspec: it's LineFinal and LineInitial which
have the desired effect in your case, not WordFinal and WordInitial.
More precisely:

- Replace \emph{a nightmare} by \emph{one more nightmare}: only the
"e" at the end of nighmare has the final "swash". Hence WordFinal
applies to words, except the last word of the italic fragment which
is governed by LineFinal.

- Add NoLineFinal: the "e" at the end of nightmare looses its swash.

But maybe it's not even a bug, and that is intended behaviour, I'm
not sure.

Remark 1: I found out about that by replacing the fontspec font calls
by the corresponding low-level LaTeX code, to see whether the culprit
was fontspec or the font. Namely I replaced

\usepackage{fontspec}% provides font selecting commands
\setmainfont[Mapping=tex-text,Ligatures={Rare,Diphthong}]{Hoefler Text}
{NoWordInitial,NoWordFinal}}}

by

\DeclareFontFamily{U}{hoeftext}{}
\DeclareFontShape{U}{hoeftext}{m}{n}
{<-> "Hoefler\space Text:mapping=tex-text;
Ligatures=Rare\space Ligatures,Diphthong\space Ligatures;
"}{}
\DeclareFontShape{U}{hoeftext}{m}{it}
{<-> "Hoefler\space Text\space Italic:mapping=tex-text;
Ligatures=Rare\space Ligatures,Diphthongs\space Ligatures;
Smart\space Swashes=!Word\space Final\space Swashes,
!Word\space Initial\space Swashes;
"}{}
\renewcommand{\encodingdefault}{U}
\renewcommand{\rmdefault}{hoeftext}

Remark 2: You can find out more about what's in a font by using AAT-
info.tex and OpenType-info.tex (in plain TeX) from the samples at
site_id=nrsi&format=file&media_id=xetex_doc_094&filename=XeTeX_doc.zip>.
These are not in TeXLive.

Remark 3: In case you've got Classic on your Mac, beware the version
3 of Hoefler Text shipped with Mac OS 9 doesn't have the same
characteristics as the version 5 shipped with Mac OS X Tiger. For
example, version 3 has small caps which version 5 doesn't have. To
make sure which version is active in case both are installed (as on
the PowerBook G4 on which I'm typing this, and on which the old
Classic version is the one active by default), you can use Font Book
or Linotype Font Explorer.

Bruno