My high level goal is to get a good, free Baskerville font working that supports smallcaps and "rare" ligatures. I have achieved this, apart from rare ligatures, using the baskervillef
package. The documentation for baskervillef seems to suggest that I should be able to get rare ligatures using the fontspec
package, but this doesn't seem to work and the process of debugging this has revealed that I don't really understand how fontspec is supposed to interact with my other code. How am I supposed to use fontspec to set options for the baskervillef font?
Here is a minimum working example that successfully loads and uses the baskervillef font:
\documentclass{article}
\usepackage{lipsum}
\usepackage{baskervillef}
\begin{document}
\section*{This Is a Section Header With a Number (1995)}
\lipsum[1][1-7]
\textfrac[3]{7}{8}
\textfrac{54}{71}
\normalfont gravestone inscription (test rare ligatures)
\itshape gravestone inscription (test rare ligatures)
\normalfont \scshape Put the Queen back in the drawer
\end{document}
I compile this using xelatex
which results in this output:
The official documentation includes the following example code on page 2, which looks like a way to get rare ligatures:
\usepackage{fontspec}
\defaultfontfeatures[\rmfamily,\sffamily]{Ligatures=TeX}\setmainfont{baskervillef}
You could add the feature Ligatures=Rare to turn on all available ligatures for the entire document
However, whenever I load the fontspec
package, either before or after loading the baskervillef package, the font stops working (output reverts to the default latex font rather than baskervillef). This occurs even if I just load the fontspec
package, as well as if I include the full code (with defaultfontfeatures
and setmainfont
) from the documentation.
Doing so produces errors such as the following in the log file:
LaTeX Font Warning: Font shape `TU/BaskervilleF-TLF/b/n' undefined
(Font) using `TU/BaskervilleF-TLF/m/n' instead on input line 7.
LaTeX Font Warning: Font shape `TU/BaskervilleF-LF/m/n' undefined
(Font) using `TU/lmr/m/n' instead on input line 10.
No file TUBaskervilleF-Sup.fd.
No file TUBaskervilleF-Dnom.fd.
...
LaTeX Font Warning: Some font shapes were not available, defaults substituted.
...
And this is what the output looks like:
Tangentially, the swash
option mentioned in the documentation doesn't seem to be supported. This could just be that the docs documentation is of date, but I mention it because the swash
option is also related to ligatures.
Here is some information about versions and my TeX setup, in case that is useful:
$ xelatex --version
XeTeX 3.14159265-2.6-0.999992 (TeX Live 2020)
kpathsea version 6.3.2
Copyright 2020 SIL International, Jonathan Kew and Khaled Hosny.
There is NO warranty. Redistribution of this software is
covered by the terms of both the XeTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the XeTeX source.
Primary author of XeTeX: Jonathan Kew.
Compiled with ICU version 65.1; using 65.1
Compiled with zlib version 1.2.11; using 1.2.11
Compiled with FreeType2 version 2.10.1; using 2.10.1
Compiled with Graphite2 version 1.3.13; using 1.3.13
Compiled with HarfBuzz version 2.6.4; using 2.6.4
Compiled with libpng version 1.6.37; using 1.6.37
Compiled with poppler version 0.68.0
Using Mac OS X Core Text and Cocoa frameworks
And I think this includes the version of my baskervillef package (this is the first few lines of the baskervillef.sty
file I could find contained in /usr/local/texlive/2020
):
%%
\NeedsTeXFormat{LaTeX2e}
\def\fileversion{1.043}
\def\filedate{2017/03/10}
\ProvidesPackage{baskervillef}
[\filedate\space v\fileversion. Style file for BaskervilleF.]
Grüße
. See also tex.stackexchange.com/a/470987/2388