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 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.

share|improve this question
    
The linked question only talks about Type 1 fonts, not OpenType fonts. –  Caramdir Mar 13 '11 at 21:04
add comment

1 Answer 1

up vote 4 down vote accepted

(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).

share|improve this answer
    
@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
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.