[Tex/LaTex] DejaVu Sans Light with XeLaTeX

fontsfontspecsans-serifxetex

In XeLaTeX, it is possible to directly embed Unicode fonts via \newfontfamily\name_to_use{font name}.

So I can, for example, write: \newfontfamily\dej{DejaVu Sans}, and later write \dej{unicode symbol from the font} – this will compile in XeLaTeX.

However I can't find a way to tell XeLaTeX to use the light series of DejaVu Sans. For example, If I type \newfontfamily\dej{DejaVu Sans Light} (or even just L with or without space)}, it says font not found – despite it being installed on my system.

Moreover, I thought that this may be a font series, so I tried \newfontfamily\dej[ln (and ln)]{DejaVu Sans}. Still does not work.

How do I set the light series of DejaVu Sans for particular Unicode symbols in my TeX file to be compiled with XeLaTeX?

Best Answer

The syntax \dej{text in DejaVu Sans} is wrong, if you have said

\newfontfamily\dej{DejaVu Sans}

because \dej doesn't become a command with an argument, but a declaration: with \dej you're telling XeLaTeX to use DejaVu Sans from that point on.

You should type

{\dej text in DejaVu Sans}

or, even better,

\newfontfamily\dej{DejaVu Sans}
\DeclareTextFontCommand{\textdej}{\dej}

in the preamble and then

\textdej{text in DejaVu Sans}

How to define a font switch for the ExtraLight series? Notice that there is no DejaVu Sans Light. This should be a font face, rather than a font family:

\documentclass{article}

\usepackage{fontspec}
\newfontface\dejlight{DejaVu Sans ExtraLight}
\DeclareTextFontCommand{\textdejlight}{\dejlight}

\begin{document}

\textdejlight{A}

\end{document}