Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I recently started using XeLaTeX on Mac OSX, and was not able to get XeLaTeX to recognize the fonts that I had installed. After opening Font Book, bringing up the Preferences dialog, and opting to install the fonts into the system-level directory (/System/Library/Fonts) instead of the user-level directory (~/Library/fonts), everything worked well.

However, I prefer not to mix the fonts that I download with the fonts that come with the operating system. In the future, I may also wish to have XeLaTeX use fonts in arbitrary directories on my system (say, some subdirectory within a local Git repository). I am very naively guessing that the reason XeLaTeX is not finding my user-level fonts is that they are not in the OS font cache. However, invoking fc-cache on my user-level font directory still does not update the output I get from fc-list with my User fonts.

So, here's my question: how can I get XeLaTeX to use TTF and OTF fonts located in arbitrary directories on my system? Currently, I can only get XeLaTeX to work with System fonts.

Thank you for your insight!

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

fontspec allows setting a path to specific fonts which are not in the current search path (or installed system-wide). This example uses SpecialFont.ttf just after downloading it:

% !TEX TS-program = XeLaTeX
\documentclass[a4paper]{article}

\usepackage{fontspec,lipsum}

\setmainfont[Path=/Users/username/Downloads/]{SpecialFont.ttf}

\begin{document}
\lipsum
\end{document} 
share|improve this answer
    
Exactly what I was looking for -- thanks a bunch! –  void-pointer Sep 6 '12 at 15:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.