Italic in section headings with Linux Biolinum

If I ask on my system

otfinfo -i /usr/local/texlive/2018/texmf-dist/fonts/opentype/public/libertine/LinBiolinum_RBO.otf

the answer is

Family:              Linux Biolinum O 
Subfamily:           Bold
Full name:           Linux Biolinum O Bold Oblique
PostScript name:     LinBiolinumOBO
Version:             Version 1.3.2 
Unique ID:           FontForge 2.0 : Linux Biolinum O Bold Oblique : 30-10-2012
Designer:            Philipp H. Poll
Designer URL:        http://www.linuxlibertine.org
Manufacturer:        Philipp H. Poll
Vendor URL:          http://www.linuxlibertine.org
Copyright:           Linux Libertine by Philipp H. Poll,
Open Font under Terms of following Free Software Licenses:
GPL (General Public License) with font-exception and OFL (Open Font License).
Created with FontForge (http://fontforge.sf.net)
Sept 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,2012
License URL:         http://www.fsf.org/licenses/gpl.html AND http://scripts.sil.org/OFL
License Description: GPL- General Public License AND OFL-Open Font License
Vendor ID:           PfEd

which means that the font doesn't correctly advertise its subfamily, which should be Bold Italic.

Solution:

\documentclass[a4paper]{scrartcl}

\usepackage{fontspec}

\setmainfont{Linux Libertine O}
\setsansfont{Linux Biolinum O}[
  BoldItalicFont=* Bold Oblique
]

\begin{document}
\section{Test \emph{emphasized} Text}
abcd ldbflsdbgf

\textbf{\textit{\textsf{Italic}}}

\section{Test \textit{italic} Text}
\end{document}

enter image description here

For manually specifying the fonts:

\documentclass[a4paper]{scrartcl}

\usepackage{fontspec}

\setmainfont{Linux Libertine O}
\setsansfont{LinBiolinum}[
  Extension=.otf,
  UprightFont=*_R,
  ItalicFont=*_RI,
  BoldFont=*_RB,
  BoldItalicFont=*_RBO,
]

\begin{document}
\section{Test \emph{emphasized} Text}
abcd ldbflsdbgf

\textbf{\textit{\textsf{Italic}}}

\section{Test \textit{italic} Text}
\end{document}

This depends on the fonts available. I also seem to lack Biolinum in a bold oblique shape as a system font, as it is not included in the SourceForge distribution. You could substitute something similar, as below (I grabbing Tex Gyre Heros, but perhaps something better is available):

    \setmainfont[]{Linux Libertine O} %\setmainfont, rather than \setromanfont

    \setsansfont[
    ItalicFont = LinBiolinumOI,
    BoldFont = LinBiolinumOB,
    BoldItalicFont = TeXGyreHeros-BoldItalic,
    BoldItalicFeatures = {Scale =0.85},
    ]{Linux Biolinum O}

enter image description here

Looks like egreg (as usual) has a better solution!

Tags:

Fonts

Xetex