4

I use font Acrobat

\setsansfont{Akrobat} 

It has 8 weight, from Thin ... to Black. This is ONLY weight, not italic. How can I use all (or some) of this styles?

  1. By default I want use Light style (not Regular)
  2. By /bfseries I want use SemiBold (not Bold). (Or create additional command for this style).
  3. Create additional command for ExtraLight style.
1
  • Mostly the font's name will be Akrobat Light then (to use within setsansfont). And for the semibold you would use \setsansfont[BoldFont=...]{...}. For (3) use \newfontfamily. You should really read the documentation of fontspec.
    – TeXnician
    Dec 3, 2017 at 8:57

1 Answer 1

10

You can define the various series in the \setsansfont declaration and then define the commands for the nonstandard font choices.

\documentclass{article}
\usepackage{fontspec}

\setsansfont{Akrobat}[
  FontFace={ul}{n}{Font=* Thin},
  FontFace={el}{n}{Font=* ExtraLight},
  FontFace={l}{n}{Font=* Light},
  FontFace={sb}{n}{Font=* SemiBold},
  FontFace={eb}{n}{Font=* ExtraBold},
  FontFace={xb}{n}{Font=* Black},
]

\DeclareRobustCommand{\ulseries}{\fontseries{ul}\selectfont}
\DeclareRobustCommand{\elseries}{\fontseries{el}\selectfont}
\DeclareRobustCommand{\lseries}{\fontseries{l}\selectfont}
\DeclareRobustCommand{\sbseries}{\fontseries{sb}\selectfont}
\DeclareRobustCommand{\ebseries}{\fontseries{eb}\selectfont}
\DeclareRobustCommand{\xbseries}{\fontseries{xb}\selectfont}
\DeclareTextFontCommand{\textul}{\ulseries}
\DeclareTextFontCommand{\textel}{\elseries}
\DeclareTextFontCommand{\textl}{\lseries}
\DeclareTextFontCommand{\textsb}{\sbseries}
\DeclareTextFontCommand{\texteb}{\ebseries}
\DeclareTextFontCommand{\textxb}{\xbseries}

\begin{document}

\sffamily
\textul{Abc Thin} {\ulseries Thin}

\textel{Abc ExtraLight} {\elseries ExtraLight}

\textl{Abc Light} {\lseries Light}

Abc Regular

\textsb{Abc SemiBold} {\sbseries SemiBold}

\textbf{Abc Bold} {\bfseries Bold}

\texteb{Abc ExtraBold} {\ebseries ExtraBold}

\textxb{Abc Black} {\xbseries Black}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .