# Making a new font family based on the default font

I'm running XeLaTeX on a Mac, and I'm getting into a lot of trouble with finding fonts.

Here's my code (taken from here: Revisiting TIPA and Fontspec)

\documentclass[12pt]{article}

\usepackage{environ}
\usepackage[no-math]{fontspec}

\newfontfamily{\tipacm}{CMU Serif}

\NewEnviron{IPA}{\expandafter\textipa\expandafter{\BODY}}
\renewcommand\useTIPAfont{\tipacm}

\begin{document}

\normalfont
\textipa{k\textscripta T\'{a}}
\textipa{kAT\'{a}}
\begin{IPA}
kAT\'{a}
\end{IPA}

\end{document}


Whenever I run it, I get the "font-not-found" error. when I search the fc-list for anything that looks like "computer modern" or any variant or abbreviation of that, I find nothing.

But obviously, my computer does have Computer Modern installed, since it's making these default pdfs fine. I would like to be able to make a new font family (e.g. \newfontfamily{\tipacm}) with the default font? If it's using a font to make a pdf, shouldn't I be able to make a renamed copy of it without having to load something externally? In essence, I'd like to make a new font family without having to load anything dependent on file paths.

Theoretically, I'd like something like: \newfontfamily{\tipacm}{\currentdefaultfontfamily}

The best is if you install CMU also in the /Library/Fonts folder. Otherwise, you can get the same with a slightly more complicated code:

\documentclass[12pt]{article}

\usepackage{environ}
\usepackage[no-math]{fontspec}

\newfontfamily{\tipacm}[
Extension=.otf,
UprightFont=*rm,
%ItalicFont=*ti,% no IPA here
BoldFont=*bx,
%BoldItalicFont=*bi,% no IPA here
]
{cmun}

\NewEnviron{IPA}{%
\expandafter\textipa\expandafter{\BODY}%
}
\renewcommand\useTIPAfont{\tipacm}

\begin{document}

\normalfont
\textipa{k\textscripta T\'{a}}
\textipa{kAT\'{a}}
\begin{IPA}
kAT\'{a}
\end{IPA}

\textbf{\textipa{A}}

\end{document}


In order to install the font also for the system, open a new Finder window, hit Command-Shift-G and type, in the box that opens,

/usr/local/texlive/2015/texmf-dist/fonts/opentype


Open another Finder window and to the same for /Library/Fonts. Now copy the folder cm-unicode from the first window to the second one.

CMU Serif is not part of Mac OSX system fonts. You have to make the TeXLive (MacTeX) fonts known to your system:

Run kpsewhich --var-value TEXMFLOCAL which shows the directoty of your local tree. This is by default for a Mac ~/Library/texmf/ but can be different on your machine. Then save the font files into ~/Library/texmf/fonts/opentype/ and run texhash after saving the files to update the filename database.

• I thought XeTeX did not use fontconfig on Mac OS X ? – user4686 Jan 14 '16 at 21:22
• I am not a MAC user. Maybe that you are right. If it doesn't use fc how does the Mac can scan other directories for fonts than the system one? – user2478 Jan 14 '16 at 21:45
• It doesn't I think: by default there is system-wide /Library/Fonts and user ~/Library/Fonts. These repertories are special. You just move fonts in there. Application FontBook allows to manage them, for example you can de-activate some of the installed fonts or also define another font repertory for installation. Installing a new font is a simple as double-clicking on it on then "Install", or from inside FontBook.app. There is also the notion of "Font Library" which you can create in "FontBook" and then add to it fonts from arbitrary locations (even network disk). – user4686 Jan 15 '16 at 7:52
• By the way the fontconfig related instructions like tug.org/texlive/doc/texlive-en/texlive-en.html#x1-340003.4.4 and the /etc/fonts/conf.d/09-texlive.conf story are completely inoperant on Mac OS. I have asked the texlive team some months ago to clarify what applies to mac os and what does not. – user4686 Jan 15 '16 at 7:57
• @jfbu: that would be a good idea to modify the web page – user2478 Jan 15 '16 at 8:05