# fontspec-example.tex on texlive 2010 and Ubuntu?

I try to run fontspec-example.tex through `xelatex` on my Ubuntu 10.10 installation, combined with texlive 2010.

The package cannot find any of the fonts, e.g., TeX Gyre Pagella (error is that kpathsea does not like the font having a space in its name). What do I do wrong? (I do have /usr/local/texlive/2010/texmf-dist/tex/latex/tex-gyre on my system.)

I tried using the tips in this question: What fonts are installed on my box?, but I am not sure I understand how to use the font names obtained there.

-
The linked question only talks about Type 1 fonts, not OpenType fonts. – Caramdir Mar 13 '11 at 21:04

(From Finding a font for XeTeX): Fonts that are installed with your TeX distribution (like the TeX Gyre fonts; look in `.../texmf-dist/fonts`) need to be called with their file name (in XeTeX; LuaTeX accepts the font name). For example,

``````\setmainfont[
Ligatures=TeX,
Extension=.otf,
UprightFont= *-regular,
BoldFont=*-bold,
ItalicFont=*-italic,
BoldItalicFont=*-bolditalic]{texgyretermes}
``````

See also the “Font selection” chapter in the fontspec manual (`texdoc fontspec`).

-
@Caramidr: thanks. This helps. Do you know if there is a way to translate the file name to a font name? Also, I noticed that .ttf are a bit different in that you can use `Comic Sans MS` as the font name, even though the file name is different. – Yossi Gil Mar 13 '11 at 21:35
@Yossi: When you double click on a font file in the file manager, a font previewer will open and (amongst other things) display the font name. – Caramdir Mar 13 '11 at 22:43