# Have XeLaTeX use the default Times font in Ubuntu

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.

-
Can you please show a minimal example of what you're trying? –  egreg Nov 6 '12 at 23:10
XeTeX can use system font using the fontconfig library. Can you try the shell command fc-list|grep Times and add the result to your question? –  egreg Nov 7 '12 at 0:36
Thanks @egreg - I do not have a Times font installed as an OTF or TTF. I would be grateful for suggestions about where one might find it. I did try Libertine Serif (as it is described in the package as having the same font metrics as Times), but it was also embedded. –  Brian M. Hunt Nov 7 '12 at 0:40
You should have TeX Gyre Termes, which is a Times clone: \setmainfont{TeX Gyre Termes} might do. –  egreg Nov 7 '12 at 0:41
@egreg: The embedding of font can be configured (at least for pdfTeX and luaTeX, and I believe for XeTeX also). It's all in the map files. updmap setoption pdftexDownloadBase14 false should force the pdf producing TeX engines to not download Times Type1 fonts (and the 13 other base fonts). –  Martin Schröder Nov 7 '12 at 9:33
show 7 more comments

## 2 Answers

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.

-
Thanks egreg (and @Martin Schröder). –  Brian M. Hunt Nov 7 '12 at 12:50
add comment

Ubuntu (as every Linux system) does not have Times font installed, but comes with a number of alternatives; the popular are:

• PT Serif (excellent Cyrillic support)
• FreeSerif
• Droid Serif (Android default)
• (Linux) Libertine Serif
• DejaVu Serif

Just check with fc-list|grep Serif` and choose one of your liking.

-
Thanks Alexander. Unfortunately this answer does not resolve the sine qua non element of the question: "[get] XeLaTeX to use a standard times font (i.e. one that would not be embedded)" –  Brian M. Hunt Nov 7 '12 at 12:48
add comment