The font Open Sans offers various font weights like, Light, Condensed Light, Regular, Semibold, Bold and Extrabold.
"Regular" and "Bold" are naturally the defaults for \mdseries
and bfseries
, but I'd prefer "Light" and "Semibold" to be the defaults.
How can I redefine the default font weights in a way, that also siunitx understands them and can detect-all
?
\documentclass{beamer}
\usepackage[utf8]{luainputenc}
\usepackage[T1]{fontenc}
\usepackage[default]{opensans}
\usepackage{siunitx}
\begin{document}
\sisetup{detect-all}
Regular numbers and unit: \SI{42}{\micro\meter}\par
\textit{Regular italic numbers and unit: \SI{42}{\micro\meter}}\par
\textbf{Bold numbers and unit: \SI{42}{\micro\meter}}\par
\textbf{\textit{Bold italic numbers and unit: \SI{42}{\micro\meter}}}\par
\medskip
But I actually want:
\smallskip
\sisetup{detect-none}
{\fontfamily{fos}\fontseries{l}\fontshape{n}\selectfont%
Regular numbers and unit: \SI{42}{\micro\meter}\par
\fontfamily{fos}\fontseries{l}\fontshape{it}\selectfont%
Regular italic numbers and unit: \SI{42}{\micro\meter}\par
\fontfamily{fos}\fontseries{sb}\fontshape{n}\selectfont%
Bold numbers and unit: \SI{42}{\micro\meter}\par
\fontfamily{fos}\fontseries{sb}\fontshape{it}\selectfont%
Bold italic numbers and unit: \SI{42}{\micro\meter}\par
}
\medskip
But \emph{detect-all} of siunitx fails and I'd like to use the commands above.
\end{document}
I thought about creating an new font composed from the sub fonts of Open Sans I'd like to use:
\DeclareFontFamily{T1}{fosn}{}
\DeclareFontShape{T1}{fosn}{m}{n}{<-> ssub * fos/l/n }{}
\DeclareFontShape{T1}{fosn}{b}{n}{<-> ssub * fos/sb/n }{}
\DeclareFontShape{T1}{fosn}{m}{it}{<-> ssub * fos/l/it }{}
\DeclareFontShape{T1}{fosn}{b}{it}{<-> ssub * fos/sb/it}{}
\renewcommand{\sfdefault}{fosn}
\renewcommand{\rmdefault}{fosn}
\renewcommand{\familydefault}{\rmdefault}
\renewcommand{\mddefault}{m}
\renewcommand{\bfdefault}{b}
\renewcommand{\seriesdefault}{\mddefault}
Which already seems to work quite good, but the greek letters still fail. Any hints?
I'm explicitly looking for a non-fontspec solution.