4

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

enter image description here

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}
2
  • If you just define \textblack{#1} as {\vollbold \textbf{#1}} (etc.), then I think it serves your purpose, doesn't it? Jun 9, 2017 at 8:26
  • @ShreevatsaR not fully, because if have more than one font, I will have to define different commands for them. I will edit the question to show that. Jun 9, 2017 at 8:34

1 Answer 1

4

You can add more series (and shapes) with the FontFace-Key. Here an example that defines \textblack for Arial Black:

\documentclass{scrartcl}

\usepackage[no-math]{fontspec}
\usepackage{polyglossia}

\setmainlanguage{english}
\defaultfontfeatures{Ligatures=TeX}

\setmainfont{Arial}%
[
 FontFace={bxx}{n}{Arial Black}
] 

\makeatletter
\DeclareRobustCommand\blackseries
        {\not@math@alphabet\blackseries\mathbf
         \fontseries{bxx}\selectfont
         }
 \makeatother        
\DeclareTextFontCommand{\textblack}{\blackseries}         
\begin{document}

abc
\textbf{abc}
\textblack{abc}

\end{document}

enter image description here

2
  • Can you please explain what does n in FontFace={bxx}{n}{Arial Black} mean? Jun 9, 2017 at 13:02
  • 1
    That's the shape. n=upright, it=italic, sl=slanted, sc=small caps are common values. You are quite free to invent new values. Look at fntguide.pdf for more info. Jun 9, 2017 at 13:06

You must log in to answer this question.

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