7

I've noticed that there are plenty of OTF and TTF fonts packaged with my new TexLive 2012. For example, the Asana-Math OTF font is in

$TEXMFDIST/fonts/opentype/public/Asana-Math

And there is a TTF in a different location. Can I use it in fontspec without intalling it in my system fonts, or specifying its absolute path?

1
  • 1
    Welcome to TeX.SE! Please consider editing your question to provide information on what you've tried so far, as well on which TeX engine (XeTeX, luaTeX?) you intend to use.
    – Mico
    Aug 19, 2012 at 12:45

3 Answers 3

4

If you only want to use fonts with UTF-8 TeX derivatives (XeTeX and LuaTeX) then you do not need to install them in your system font folder. Depending on your operating system and engine choice, using the font name may be less reliable than using the font file name. I would therefore favour doing the latter whether you are using system-wide or TeX tree fonts.

For example,

\documentclass{article}
\usepackage{unicode-math}
\setmathfont{Asana-Math.otf}
\begin{document}
$y = mx + c$
\end{document}

works on my system with both XeLaTeX and LuaLaTeX, but I do not have Asana Math installed system-wide (i.e. not available in for example Word).

4
  • Asana Math is part of TeXLive, the reason why it is found
    – user2478
    Aug 19, 2012 at 16:08
  • @Herbert Exactly the point I'm making: it's installed in the TeX tree, so is found by XeTeX and LuaTeX, but does not need to be copied into the system-wide tree.
    – Joseph Wright
    Aug 19, 2012 at 16:09
  • sure, but I understand that the question refers to a TrueType in another location.
    – user2478
    Aug 19, 2012 at 16:17
  • @Herbert I think we read the question in different ways: I guess we need the OP to clarify.
    – Joseph Wright
    Aug 19, 2012 at 18:36
2

copy the file into

$TEXMFLOCAL/fonts/truetype/.../

then run texhash or update your database when running MiKTeX. Then you can use the font with its font name, eg

\usepackage{fontenc}
\setmainfont{Helvetica Neue}

if you are running Linux, then you can save the files under /home/$USER/.fonts/, run fc-cache and it will be found by xelatex

0

With LuaTeX you can use fonts installed by TeX Live (i.e. under TEXMF tree) the same way you use system fonts. XeTeX does not support this yet, but on Linux/Windows you can follow the instruction here to make TeX Live fonts available system wide so that XeTeX can find it.

Alternatively, you can call the fonts by their file names which works with TEXMF tree fonts in both engines, but it can be a bit complex if you want to use more than one font style. Check fontspec documentation on how to load fonts by file names.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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