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 have installed an open-type font on my OS and would like to use in a LaTeX document using XeLaTeX.

It works fine, but when I define my font family like this:

\ifxetex
  \newfontfamily{\neosans}{NeoSans} 
\else
\fi

When I then use \selectfont\neosansit just selects the Regular version of that font. However, I would like to use the Light version!

Even if I write \newfontfamily{\neosans}{NeoSans-Light} or \newfontfamily{\neosans}{NeoSans Light} it still chooses the Regular version.

The specifications of the font I would like to use looks as follows (in Danish, though):

Link to image

My question is

How do use the Light version of the font?

share|improve this question

1 Answer 1

up vote 13 down vote accepted

I don't have NeoSans, but experimented with another font:

\documentclass{article}
\usepackage{fontspec}
\newfontfamily{\os}{Open Sans}
\newfontfamily{\osl}[UprightFont={* Light}]{Open Sans}
\begin{document}
{Normal: \os Open Sans\par}
{Light: \osl Open Sans Light\par}
\end{document}

You see that the second line indeed chooses the light version.

enter image description here

Notice that \selectfont is not needed (and does nothing).

In your case you probably want to also change the italic and bold version:

\newfontfamily{\neosans}
  [Ligatures=TeX, % recommended
   UprightFont={* Light},
   ItalicFont={* Light Italic},
   BoldFont={* Medium},
   BoldItalicFont={* Medium Italic}]
  {NeoSans}

If you want that NeoSans is used as the standard sans serif font, then instead of \newfontfamily{\neosans} write \setsansfont:

\setsansfont
  [Ligatures=TeX, % recommended
   UprightFont={* Light},
   ItalicFont={* Light Italic},
   BoldFont={* Medium},
   BoldItalicFont={* Medium Italic}]
  {NeoSans}
share|improve this answer
    
@Zappel This is another question; the second argument specifies the distance between baselines, but TeX won't overlap lines anyway. –  egreg Jul 8 '12 at 15:59
    
@Zappel New questions should not go in comments. This has nothing to do with fontspec. Please, make a new question. –  egreg Jul 8 '12 at 16:13

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.