# HG changeset patch # User Franz Glasner # Date 1778666901 -7200 # Node ID d57cf1bb96d6c9cd3059ad4ccaa64c4002f62afd # Parent 959ed927b5fa32e4b8032b78d066c1b0b7d5c7c0 A new PDF style using "Spectral" with Source Sans/Code diff -r 959ed927b5fa -r d57cf1bb96d6 docs/_latex/my-doc-fonts.sty --- a/docs/_latex/my-doc-fonts.sty Wed May 13 12:01:36 2026 +0200 +++ b/docs/_latex/my-doc-fonts.sty Wed May 13 12:08:21 2026 +0200 @@ -14,15 +14,19 @@ \RequirePackage{color} } +\newif\if@mdf@@sspro\@mdf@@ssprofalse + \newif\if@mdf@WithDejaVuSansMono \newif\if@mdf@WithPlexMono \newif\if@mdf@WithAdobeSource +\newif\if@mdf@WithSpectral \def\@mdf@reset@font@options{\@mdf@WithDejaVuSansMonofalse\@mdf@WithPlexMonofalse\@mdf@WithAdobeSourcefalse} \DeclareOptionX{dejavusansmono}[true]{\@mdf@reset@font@options\csname @mdf@WithDejaVuSansMono#1\endcsname} \DeclareOptionX{plexmono}[true]{\@mdf@reset@font@options\csname @mdf@WithPlexMono#1\endcsname} \DeclareOptionX{adobesource}[true]{\@mdf@reset@font@options\csname @mdf@WithAdobeSource#1\endcsname} +\DeclareOptionX{spectral}[true]{\@mdf@reset@font@options\csname @mdf@WithSpectral#1\endcsname} % % By default use the safe option dejavusansmono because is contains @@ -73,7 +77,6 @@ {sphinx} \fi \if@mdf@WithAdobeSource - \RequirePackage{newunicodechar} \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}} \setmainfont{Source Serif Pro}[ UprightFont = *, @@ -81,6 +84,24 @@ ItalicFont = * Italic, BoldItalicFont = * Bold Italic, ] + \@mdf@@ssprotrue +\fi +\if@mdf@WithSpectral + \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}} + \setmainfont{Spectral}[ + UprightFont = * Regular, + BoldFont = * Bold, + ItalicFont = * Italic, + BoldItalicFont = * Bold Italic, + ] + \@mdf@@ssprotrue +\fi + +\defaultfontfeatures{} + +\if@mdf@@sspro + \RequirePackage{newunicodechar} + \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular},Scale=MatchLowercase} \setsansfont{Source Sans Pro}[ UprightFont = *, BoldFont = * Bold, @@ -92,7 +113,6 @@ BoldFont = * Bold, ItalicFont = * Italic, BoldItalicFont = * Bold Italic, - Scale = MatchLowercase, ] \defaultfontfeatures{} \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[% @@ -100,8 +120,6 @@ BoldFont = * Bold, ItalicFont = * Oblique, BoldItalicFont = * Bold Oblique, - Scale=MatchLowercase, - Ligatures=TeX, ] \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236 \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5 @@ -111,10 +129,13 @@ \newunicodechar{⇔}{{\DejaVuSansMono ⇔}}% U+21D4 \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208 - \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C + \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C \PassOptionsToPackage{% verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},% verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}% {sphinx} \fi + +\defaultfontfeatures{} + \endinput diff -r 959ed927b5fa -r d57cf1bb96d6 docs/conf.py --- a/docs/conf.py Wed May 13 12:01:36 2026 +0200 +++ b/docs/conf.py Wed May 13 12:08:21 2026 +0200 @@ -147,7 +147,8 @@ "papersize": "a4paper", "babel": r"\usepackage{babel}", "fontpkg": r"\usepackage[plexmono]{my-doc-fonts}", -# "fontpkg": r"\usepackage[adobesource]{my-doc-fonts}", +# "fontpkg": r"\usepackage[adobesource]{my-doc-fonts}", +# "fontpkg": r"\usepackage[spectral]{my-doc-fonts}", "releasename": "Version", } latex_theme = "manual"