I have downloaded a font Vollkorn
from https://www.fontsquirrel.com/fonts/vollkorn that features 8 styles: regular, semi-bold, bold, black and each of them italized. There are also fonts with 18 styles, but I guess it is not needed for the illsutration.
I want to use all these styles, so I would like to do something like this:
\newfontfamily\voll{Vollkorn-Regular.ttf}%
[
Extension = .ttf,
ItalicFont = Vollkorn-Italic,
SemiBoldFont = Vollkorn-Semibold,
SemiBoldItalicFont = Vollkorn-SemiBoldItalic,
BoldFont = Vollkorn-Bold,
BoldItalicFont = Vollkorn-BoldItalic,
BlackFont = VollkornBlack,
BlackItalicFont = Vollkorn-BlackItalic
]
And then somewhere in the document:
\textblack{Black Text}, \textsemibolditalic{Semi-Bold Italized}.
I don't know how to do it, so right now I have defined to families: voll
--- for normal font, which bold version is semi-bold and vollbold
, which normal version is bold, and which bold version is black:
\newfontfamily\voll{Vollkorn-Regular.ttf}%
[
Extension = .ttf,
BoldFont = Vollkorn-Semibold,
ItalicFont = Vollkorn-Italic,
BoldItalicFont = Vollkorn-SemiBoldItalic
]
\newfontfamily\vollbold{Vollkorn-Bold.ttf}%
[
Extension = .ttf,
BoldFont = Vollkorn-Black,
ItalicFont = Vollkorn-BoldItalic,
BoldItalicFont = Vollkorn-BlackItalic
]
To produce the desired output I do
\voll
This is normal font\\
\textbf{Applying bf to normal font, we get the semibold version}\\
\vollbold We now swith to bold version\\
\textbf{And now the bold version of bold version, a.\,k.\,a. BLACK}
Which produces
EDIT: as mentioned in the comments, doing \newcommand{\textblack}[1]{{\vollbold\textbf{#1}}}
doesn't serve the purpose, because if I have more than one font with a lot of styles, I want to use \textblack
with all of them, without defining a special command for each of them.
Can I make my life easier and do what I want to?
Here is full MWE (compilable with LuaLaTeX and maybe, XeLaTeX)
\documentclass{scrartcl}
\usepackage[no-math]{fontspec}
\usepackage{polyglossia}
\setmainlanguage{english}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Vollkorn}
\newfontfamily\voll{Vollkorn-Regular.ttf}%
[
Extension = .ttf,
BoldFont = Vollkorn-Semibold,
ItalicFont = Vollkorn-Italic,
BoldItalicFont = Vollkorn-SemiBoldItalic
]
\newfontfamily\vollbold{Vollkorn-Bold.ttf}%
[
Extension = .ttf,
BoldFont = Vollkorn-Black,
ItalicFont = Vollkorn-BoldItalic,
BoldItalicFont = Vollkorn-BlackItalic
]
\begin{document}
\noindent%
\voll
This is normal font\\
\textbf{Applying bf to normal font, we get the semibold version}\\
\vollbold We now swith to bold version\\
\textbf{And now the bold version of bold version, a.\,k.\,a. BLACK}
\end{document}
\textblack{#1}
as{\vollbold \textbf{#1}}
(etc.), then I think it serves your purpose, doesn't it?