1

I am loading NCM (New Computer Modern) with

\documentclass{scrartcl}
\usepackage{polyglossia}
\setdefaultlanguage[babelshorthands]{german}
\setotherlanguage[variant=british]{english}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%           Font 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setmainfont{NewCM10-Book.otf}  % Ligatures: bei newfontface definiert

% Get Ligatures for NCM in german!
\newfontface\germanfont{NewCM10-Book.otf}[%
    Script=Latin,
    Language=Default,
    Ligatures={Common},
    ItalicFont=NewCM10-BookItalic.otf,%
    BoldFont=NewCM10-Bold.otf,%
    BoldItalicFont=NewCM10-BoldItalic.otf,%
    SmallCapsFeatures={Numbers=OldStyle}
]

\setsansfont{NewCMSans10-Book.otf}[%
ItalicFont=NewCMSans10-Oblique.otf,%
BoldFont=NewCMSans10-Bold.otf,%
BoldItalicFont=NewCMSans10-BoldOblique.otf,%
SmallCapsFeatures={Numbers=OldStyle}]

\setmonofont{NewCMMono10-Book.otf}[%
ItalicFont=NewCMMono10-Italic.otf,%
BoldFont=NewCMMono10-Bold.otf,%
BoldItalicFont=NewCMMono10-BoldOblique.otf,%
SmallCapsFeatures={Numbers=OldStyle}]

\begin{document}
    \textbf{\textsc{Text}}
\end{document}

and I am not sure, why I do not get bold small caps.

What do I need to add so that I can use \textbf{\textsc{Text}} in my documents? Currently I only seem to be getting bold text.

Text

UPDATE

It seems to be a problem with polyglossia. If I use the package provided for NewCM called fontsetup which is basically the same as \setmainfont{…}, … for NewCM I managed to get small caps and bold small caps without polyglossia.

Only when loading polyglossia it breaks again…

Example without polyglossia: without polyglossia

UPDATE 2

I have switched to babel now, which seems to be working like a charm without any problem.

6
  • The New Computer Modern fonts probably only have small caps in the Regular styles, i.e., Bold small caps don’t exist. Commented Mar 13, 2022 at 16:47
  • New Computer Modern have small caps in bold face, try to run optex to the file: \fontfam[newcm] \caps\bf Text. \bye
    – wipet
    Commented Mar 13, 2022 at 17:03
  • @wipet Huh... Then the problem is most certainly how the OP sets up the font. Commented Mar 13, 2022 at 17:51
  • 1
    Why \setmainfont{NewCM10-Book.otf} then \newfontface\germanfont{NewCM10-Book.otf}[...]? The two setups include almost the exact same Script, Language and Ligatures settings (btw, you probably want Ligatures={Common,TeX}). A single \setmainfont{NewCM10-Book.otf}[ItalicFont=...,BoldFont=...,...] should work. You probably also need SmallCapsFeatures={Letters=SmallCaps,Numbers=OldStyle}. Commented Mar 13, 2022 at 17:54
  • @RuixiZhang I needed the \newfontface\germanfont{…} because of a bug previously. The ligatures were not working for german if I was using polyglossia. But I'll try that. My previous question: tex.stackexchange.com/questions/631464/… Commented Mar 13, 2022 at 18:57

1 Answer 1

1

There are a few intersecting problems here. The first is that, when you load NewCM10, LaTeX looks for the file NewCM10.fontspec. This only declares bold and italic faces within a SizeFeatures= block, which confuses polyglossia into not being able to find the bold font. The solution to that is to copy and paste the contents of the .fontspec file, adding a fallback:

\defaultfontfeatures[NewCM10-Book]
   {
    Extension = .otf ,
    Font = NewCM10-Book,
    ItalicFont=NewCM10-BookItalic,%
    BoldFont=NewCM10-Bold,%
    BoldItalicFont=NewCM10-BoldItalic,%
    SlantedFont=NewCM10-Book,%
    BoldSlantedFont=NewCM10-Bold,%
    SmallCapsFeatures={Numbers=OldStyle},
    SizeFeatures={%
            {Size=-8, Font=NewCM08-Book,
                    ItalicFont=NewCM08-BookItalic,%
                    BoldFont=NewCM10-Bold,%
                    BoldItalicFont=NewCM10-BoldItalic,%
                    SlantedFont=NewCM08-Book,%
                    BoldSlantedFont=NewCM10-Bold,%
                    SmallCapsFeatures={Numbers=OldStyle}},
            {Size=8, Font=NewCM08-Book,
                    ItalicFont=NewCM08-BookItalic,%
                    BoldFont=NewCM10-Bold,%
                    BoldItalicFont=NewCM10-BoldItalic,%
                    SlantedFont=NewCM08-Book,%
                    BoldSlantedFont=NewCM10-Bold,%
                    SmallCapsFeatures={Numbers=OldStyle}},
          {Size= 9-, Font = NewCM10-Book,
                    ItalicFont=NewCM10-BookItalic,%
                    BoldFont=NewCM10-Bold,%
                    BoldItalicFont=NewCM10-BoldItalic,%
                    SlantedFont=NewCM10-Book,%
                    BoldSlantedFont=NewCM10-Bold,%
                    SmallCapsFeatures={Numbers=OldStyle}}%
    }}

Having done that, you can now load the font as your main font:

\setmainfont{NewCM10-Book}  % Ligatures: bei newfontface definiert

The font does provide Language=German, but it is broken. You could therefore also load,

\newfontfamily\germanfont{NewCM10-Book}[Language=German]

But, if you do this, the font file does not enable the small-caps feature with Language=German, so it will simply break. With Language=Default, the \textsc command will follow traditional orthography, rather than giving you a Großes Eszett.

This, inclidentally, means that someone using babel to set New Computer Modern as the German font needs to, in addition to the extra setup above, override the automatic language selection with something like \babelfont[german]{rm}[Language=Default]{NewCM10-Book}.

The MWE

\documentclass{scrartcl}
\usepackage{polyglossia}
\setdefaultlanguage[babelshorthands]{german}
\setotherlanguage[variant=british]{english}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%           Font 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\defaultfontfeatures[NewCM10-Book]
   {
    Extension = .otf ,
    Font = NewCM10-Book,
    ItalicFont=NewCM10-BookItalic,%
    BoldFont=NewCM10-Bold,%
    BoldItalicFont=NewCM10-BoldItalic,%
    SlantedFont=NewCM10-Book,%
    BoldSlantedFont=NewCM10-Bold,%
    SmallCapsFeatures={Numbers=OldStyle},
    SizeFeatures={%
            {Size=-8, Font=NewCM08-Book,
                    ItalicFont=NewCM08-BookItalic,%
                    BoldFont=NewCM10-Bold,%
                    BoldItalicFont=NewCM10-BoldItalic,%
                    SlantedFont=NewCM08-Book,%
                    BoldSlantedFont=NewCM10-Bold,%
                    SmallCapsFeatures={Numbers=OldStyle}},
            {Size=8, Font=NewCM08-Book,
                    ItalicFont=NewCM08-BookItalic,%
                    BoldFont=NewCM10-Bold,%
                    BoldItalicFont=NewCM10-BoldItalic,%
                    SlantedFont=NewCM08-Book,%
                    BoldSlantedFont=NewCM10-Bold,%
                    SmallCapsFeatures={Numbers=OldStyle}},
          {Size= 9-, Font = NewCM10-Book,
                    ItalicFont=NewCM10-BookItalic,%
                    BoldFont=NewCM10-Bold,%
                    BoldItalicFont=NewCM10-BoldItalic,%
                    SlantedFont=NewCM10-Book,%
                    BoldSlantedFont=NewCM10-Bold,%
                    SmallCapsFeatures={Numbers=OldStyle}}%
    }}


\setmainfont{NewCM10-Book}  % Ligatures: bei newfontface definiert

\begin{document}
    \noindent\textbf{\textsc{Frauenfußball}} \\
    \textsc{Frauenfußball} \\
    \textbf{Frauenfußball}
\end{document}

New Computer Modern sample

if you also want this to work for sans-serif and monospace, you need to do something similar with NewCMMono10-Book and NewCMSans10-Book.

What if you really want the Großes Eszett? If you don’t want to be pragmatic and switch to some other font that makes this substitution, I did write some code back in 2020 that could be adapted to capitalize using the de-alt rules and rescale to get an \ersatzsc command.

4
  • Wow. Thanks a lot for your answer. To be quite honest I did not want to have these extravagant features and settings in order to enable textsc for my document. I was just trying to write a german document in NCM and needed bold, sc for my labelfont in my captions. I have thus switched to babel as I wrote in Update 2. It is nice to see that it is possible to modify the settings in fontspec and in polyglossia a lot. Although I do not find this particularly "user-friendly". How did you find out about all of this? Commented Mar 14, 2022 at 14:23
  • @MartinDagleish Well, you shouldn’t have to go through all that rigmarole just to use \textsc with Polyglossia. What I entered is what the NewCM10-Book.fontspec file really ought to say. Then you could just \setmainfont{NewCM10-Book}, and it would just work. Alternatively, fontspec could be rewritten to work with the file that’s out there.
    – Davislor
    Commented Mar 14, 2022 at 17:01
  • @MartinDagleish I don’t know how helpful this is to you, but I heard that fontspec now looks for a .fontspec file from a presentation by Will Robertson in 2018, and from there it was a matter of searching for the filename and checking what it says. I found out about the missing small-caps feature for German by checking otfinfo --script=latn.DEU -f on the font file.
    – Davislor
    Commented Mar 14, 2022 at 17:05
  • Ok thank you! That's amazing. I would have never found out about all of this! I appreciate you taking the time to explain all of this! :) Commented Mar 14, 2022 at 17:45

You must log in to answer this question.

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