[Tex/LaTex] Have XeLaTeX use the default Times font in Ubuntu

fontspdfxetex

Using the Texlive PPA backport to Ubuntu 12.04, I am having trouble getting XeLaTeX to use a standard times font (i.e. one that would not be embedded).

I am using e.g. \setmainfont{times} and \newfontfamily\fontfamilyname{Times}, and have installed the texlive-fonts-recommended package, which says (in the apt-cache show texlive-fonts-recommended):

 times -- Select Adobe Times Roman (or equivalent) as default font.
 timesnew -- the URW Times fonts and support for the Adobe font set.

When I run xelatex on a tex file that tries to use the fonts above, I get a long list of errors, many like the following:

Please type another input file name
! Emergency stop.
 ...e:=ljfour; mag:=1; nonstopmode; input times

Transcript written on mfput.log.
grep: times.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input times'
 failed to make times.tfm.

kpathsea: Running mktextfm times
/usr/share/texlive/texmf/web2c/mktexnam: Could not map source abbreviation  for times.
/usr/share/texlive/texmf/web2c/mktexnam: Need to update ?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input times
This is METAFONT, Version 2.718281 (TeX Live 2012/Debian)

I would be grateful for thoughts on how to use the standard Times font in PDFs created with XeLaTeX on Ubuntu.


EDIT Sorry I didn't post the example earlier — had to put the little one to bed, and I had hoped this was a mind-numbingly simple oversight on my part 🙂

Here's an example:

\documentclass{memoir}
\usepackage{fontspec} 
\setmainfont{Times}
\begin{document}
 In Times we trust.
\end{document}

Here is what XeLaTeX responds with:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
! 
! The font "Times" cannot be found.
! 
! See the fontspec documentation for further information.
! 
! For immediate help type H <return>.
!...............................................  

One solution that occurs to me is to manually install an OTF or TTF font that is a substitute for Times, but I would expect that the texlive distribution or Ubuntu otherwise has that – but it is not immediately apparent where.

Best Answer

As far as I know, the 14 base fonts that all PDF readers should know are Type1 fonts (Times, Courier, Helvetica, Symbol and Zapf Dingbats) and they don't support arbitrary Unicode.

So, while with (pdf)latex it would be possible to avoid downloading the base fonts in a PDF document by setting the corresponding option

updmap-sys setoption pdftexDownloadBase14 false
updmap-sys setoption dvipsDownloadBase14 false

(thanks to Martin Schröder for pointing to the command, see the man page of updmap for more information; end with true for reverting to the default), this has little sense with XeLaTeX, because it would deprive it of its main feature, that is, dealing with OpenType or TrueType fonts covering the whole Unicode character set.

Thus, if you plan to use XeLaTeX for exploiting OpenType features, let XeTeX and xdvipdfmx download the font to the PDF file.