3

I have tried a few things, but my problem is that I want the common Ligatures to be on (maybe even more ligatures).

Through testing I noticed that polyglossia with the option: \setdefaultlanguage[babelshorthands]{german} or just \setdefaultlanguage{german} seemed to turn off the Ligatures={Common}, which I am using in fontspec.

MWE (working Ligatures, but NOT german):

% !TeX program = lualatex
\documentclass{scrartcl}

\usepackage{fontspec}
\usepackage[
    math-style=TeX,
    bold-style=ISO,
    nabla=upright,
    %partial=upright,
    warnings-off={%
            mathtools-colon,%
            mathtools-overbracket}
]{unicode-math}
\usepackage{polyglossia}
% \setdefaultlanguage[babelshorthands]{german}
% \setotherlanguage[variant=british]{english}

\setmainfont{NewCM10-Book.otf}[%
  Ligatures={Common}
]


\setsansfont{NewCMSans10-Book.otf}

\setmonofont{NewCMMono10-Book.otf}

\setmathfont[CharacterVariant=1]{NewCMMath-Book.otf}
\setmathfont[range={scr,bfscr}]{XITS Math}

\begin{document}
    Test \par 
    AE ae oe ff fi ij st ft ss ffi
\end{document}

MWE (NOT working Ligatures, but german):

% !TeX program = lualatex
\documentclass{scrartcl}

\usepackage{fontspec}
\usepackage[
    math-style=TeX,
    bold-style=ISO,
    nabla=upright,
    %partial=upright,
    warnings-off={%
            mathtools-colon,%
            mathtools-overbracket}
]{unicode-math}
\usepackage{polyglossia}
\setdefaultlanguage[babelshorthands]{german}
\setotherlanguage[variant=british]{english}

\setmainfont{NewCM10-Book.otf}[%
  Ligatures={Common}
]


\setsansfont{NewCMSans10-Book.otf}

\setmonofont{NewCMMono10-Book.otf}

\setmathfont[CharacterVariant=1]{NewCMMath-Book.otf}
\setmathfont[range={scr,bfscr}]{XITS Math}

\begin{document}
    Test \par 
    AE ae oe ff fi ij st ft ss ffi
\end{document}

The output in the german I get:

Package fontspec Warning: OpenType feature 'Ligatures=Common' (liga) not
(fontspec)                available for font 'NewCM10-Book' with script
(fontspec)                'CustomDefault' and language 'German'.
1
  • Just out of curiosity: Have you tried running \usepackage[ngerman]{babel} instead of loading the polyglossia package?
    – Mico
    Jan 25, 2022 at 20:11

1 Answer 1

3

This font NewComputerModern explicitly disables most font features (including ligatures and kerning) for german text. You can reenable it by requesting a different language (or just the falback Default language). To stop polyglossia from overwriting such a request, you have to provide an explicit \germanfont with the settings which should be applied for german:

% !TeX program = lualatex
\documentclass{scrartcl}

\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage[babelshorthands]{german}

\setmainfont{NewCM10-Book.otf}[%
  Ligatures={Common}
]

% polyglossia would automatically add Script=Latin, Language=German.
% Instead we manually specify a german font and specify Language=Default
% to aoid the german specific feature handling in NCM.
\newfontface\germanfont{NewCM10-Book.otf}[%
  Script=Latin,
  Language=Default,
  Ligatures={Common}
]

\begin{document}
    Test \par 
    AE ae oe ff fi ij st ft ss ffi
\end{document}

You must log in to answer this question.

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