1

I use a large family of fonts, containing a lot of fontfaces. Besides standart Upright, Bold, Italic, and BoldItalic I need to use, e. g. Semibold.

I define the new face with

FontFace        =   {semibold}{n}{*Semibold},
FontFace        =   {semibold}{it}{*SemiboldIt},

And I need something similar to

UprightFeatures =   {
                        SizeFeatures={
                            {Size={-8.9},       Font    =   *Capt},
                            {Size={8.4-12.9},   Font    =   *Regular},
                            {Size={13.0-22.9},  Font    =   *Subh},
                            {Size={22.9-},      Font    =   *Disp}
                        }
},

But for the semibold.

How can I do this?

LuaLaTeX MWE:

\documentclass{article}

\newcommand{\MyPath}{} % Your Path to the fonts here

\usepackage{polyglossia}
\usepackage{mathtools}
\usepackage{tabularx}
\usepackage{booktabs}

\setmainlanguage{english}

\setmainfont{WarnockPro-}[%
    Extension       =   .otf,
    UprightFont     =   *Regular,
    ItalicFont      =   *It,
    BoldFont        =   *Bold,
    BoldItalicFont  =   *BoldIt,
    FontFace        =   {semibold}{n}{*Semibold},
    FontFace        =   {semibold}{it}{*SemiboldIt},
    Path            =   \MyPath,
    Ligatures       =   {TeX,Rare,Common},
    Contextuals     =   {Swash},
    Numbers         =   {Uppercase},
    Style           =   {Historic},
    Kerning         =   {On},
    UprightFeatures =   {
                            SizeFeatures={
                                {Size={-8.9},       Font    =   *Capt},
                                {Size={8.4-12.9},   Font    =   *Regular},
                                {Size={13.0-22.9},  Font    =   *Subh},
                                {Size={22.9-},      Font    =   *Disp}
                            }
    },
    ItalicFeatures  =   {
                            SizeFeatures={
                                {Size={-8.9},       Font    =   *ItCapt},
                                {Size={8.4-12.9},   Font    =   *It},
                                {Size={13.0-22.9},  Font    =   *ItSubh},
                                {Size={22.9-},      Font    =   *ItDisp}
                            }
    },
    BoldFeatures    =   {
                            SizeFeatures={
                                {Size={-8.9},       Font    =   *BoldCapt},
                                {Size={8.4-12.9},   Font    =   *Bold},
                                {Size={13.0-22.9},  Font    =   *BoldSubh},
                                {Size={22.9-},      Font    =   *BoldDisp}
                            }
    },
    BoldItalicFeatures  =   {
                            SizeFeatures={
                                {Size={-8.9},       Font    =   *BoldItCapt},
                                {Size={8.4-12.9},   Font    =   *BoldIt},
                                {Size={13.0-22.9},  Font    =   *BoldItSubh},
                                {Size={22.9-},      Font    =   *BoldItDisp}
                            }
    },
]

\makeatletter

\DeclareRobustCommand\semiboldseries % Defines SEMIBOLD series
{\not@math@alphabet\semiboldseries\mathbf
    \fontseries{semibold}\selectfont
}

\makeatother 

\newcommand{\GO}{ % Typesets dummy text
    \resizebox{!}{12pt}{\fontsize{7}{7}\selectfont Test Word}

    \resizebox{!}{12pt}{\fontsize{10}{10}\selectfont Test Word}

    \resizebox{!}{12pt}{\fontsize{16}{16}\selectfont Test Word}

    \resizebox{!}{12pt}{\fontsize{40}{40}\selectfont Test Word}
}

\begin{document}


\begin{tabularx}{\textwidth}{ X X X X }
    \toprule
           & Regular              & Semibold                   & Bold                 \\ \midrule
    Italic & \itshape\mdseries\GO & \itshape\semiboldseries\GO & \itshape\bfseries\GO \\[3mm]
    Up     & \mdseries\GO         & \semiboldseries\GO         & \bfseries\GO         \\ \bottomrule
\end{tabularx}


\end{document}

Works for italic and bold just as expected:

enter image description here

3

The "official" NFSS identifier for semibold is sb (see LaTeX 2e font selection), so I will use this instead of semibold. You can pass font features, including SizeFeatures, to FontFace with

FontFace        =   {sb}{n}{
                        Font = *Semibold,
                        SizeFeatures = {
                          {Size= -8.9,   Font    =   *CaptSemibold},
                          {Size=8.9-22.9}, % No Font=, so *Semibold is used
                          {Size=22.9- ,   Font    =   *DispSemibold},
                        }
                    },

For more information you can look at the fontspec documentation, section 2.3

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.