0

I'm using Montserrat as a custom font for my latex document and I would like to change the font weight and letter spacing for my text. I've figured out how to change the font weight and change the letter spacing but if I'm doing both at the same time the letter spacing does not change. I'm using lualatex to compile, here is some code to illustrate my issue

\documentclass{article}

\usepackage{fontspec}

\setmainfont{Montserrat}
\newfontfamily{\thin}{Montserrat Thin}
\newfontfamily{\extralight}{Montserrat Extra light}
\newfontfamily{\light}{Montserrat Light}
\newfontfamily{\medium}{Montserrat Medium}
\newfontfamily{\semibold}{Montserrat Semi Bold}
\newfontfamily{\bold}{Montserrat Bold}
\newfontfamily{\extrabold}{Montserrat Extra bold}
\newfontfamily{\black}{Montserrat Black}

\begin{document}

{
\begin{center}
\addfontfeatures{LetterSpace=50}
\Huge
\thin
The quick brown fox jumped over the lazy dogs.
\end{center}
}

\end{document}

I'm pretty new to latex so I would not be surprised if I'm doing something wrong. If anyone can help me solve my current issue or show me how to "properly" change font properties like these it would be greatly appreciated.

2
  • What I understand from the documentation of \addfontfeatures is that, it only affects the current font family, while the font family is changed by \thin. – muzimuzhi Z Aug 5 '20 at 17:11
  • @muzimuzhiZ Wow, your comment put me in the right direction. I just added it after \thin and it worked lol. Can't belive it was that simple, thank you. – brw.064 Aug 5 '20 at 17:22
2

(This answer is converted from my own comment, so that this question can be marked solved.)

According to the documentation of \addfontfeatures (user manual of fontspec, sec. III.2), it only affects the current font family. The \thin used after \addfontspec changes the font family, hence cancels effect of \addfontspec.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.