I'm having trouble changing the font family inside of my document. I want my document to be in Times New Roman, which is small and has the appropriate characters. However, I have sections of the paper that require small caps as well as special characters, which Times New Roman does not provide. I would like to switch to Charis SIL (which is a less compact font) for this. Here is an example of the code I am using:
\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage{expex}
\lingset{belowglpreambleskip=0ex, aboveglftskip=0ex, everygla={\upshape}}
\setmainfont{Times New Roman}
\begin{document}
This text is in the default font, Times New Roman. The example should be in Charis SIL.
{\fontfamily{Charis SIL}\selectfont
\ex \label{gohome}
\begingl
\glpreamble ʔucačiƛs wałšiƛ. //
\gla ʔu-ca-čiƛ=s wał-šiƛ //
\glb \textsc{x}-go-\textsc{perf}=\textsc{strg.1sg} go.home-\textsc{perf} //
\glft `I went home.' //
\endgl
\xe
}
\end{document}
However, I get a strange output:
Not only do I not get the font selection, but I get the odd "sil.fd SIL.fd" in front. Now, if I set the document font to Charis SIL, e.g.
\setmainfont{Times New Roman}
...this is what I see for the relevant section:
Is there any way to selectively alternate between my main document font and Charis SIL?
\fontfamily
expects the name of a TeX font family, so LaTeX looks for an appropriately named.fd
file in the current encoding. None exists, so it tells you it can't switch and falls back to the default. Please edit your question to provide code for a complete but minimal document which generates the problematic output you show. If you can do this without relying on non-standard fonts, that's best. (Times New Roman is commercial, for example.)\selectfont
it with those engines.