diff docs/_latex/my-doc-fonts.sty @ 196:d57cf1bb96d6

A new PDF style using "Spectral" with Source Sans/Code
author Franz Glasner <fzglas.hg@dom66.de>
date Wed, 13 May 2026 12:08:21 +0200
parents c10b2092c48f
children ede8b44f6faf
line wrap: on
line diff
--- 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