I am trying to customize this document, it's a CV template for XeTeX. What I'd like to be able to do is change the main font. I belive the section of the code I need to change is this:
%FONTS
\defaultfontfeatures{Mapping=tex-text}
\setmainfont[SmallCapsFont = Fontin SmallCaps]{Fontin}
I downloaded and installed Fontin just to be able to see the document in its original form before trying to customize it. It works fine.
Now I need some other fonts to try, and I can't figure out how to find out the font names I could use. I tried a few well-known names like Times and Verdana, these fonts were not found. Also tried some font names I have found in different documents and webpages, eg. Cambria, TeX Gyre Bonum, Lucida Grande, which were rejected because either they were not found or their names contained an illegal character: a space. (Which pretty much stunned me since the fontspec
documentation is full of multi-word font names…)
The documentation on the fontspec
package (v2.1e 2010/11/17) doesn't help me much. All it says about this is "TODO: add explanation for how to find out what the font name is."
So how do I find the names of the fonts I can use?
Edit:
I'm using Ubuntu 10.10 with the latest TeXlive 2010 from tug.org.
Best Answer
Your operating system should have some font previewer that shows the font name when you double click on a file. Spaces should not pose any problems (e.g.
\setmainfont{Linux Libertine O}
works if you have the otf version of Linux Libertine installed). The error message for fonts with spaces that are not found is rather misleading. It means that the font is not installed and not that spaces are not allowed.Of course you can only use fonts that are actually installed on your system. Under Linux, fonts are (I think) usually under
/usr/share/fonts/
and$HOME/.fonts
. Also trylocate .ttf
andlocate .otf
.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,