changeset 191:c10b2092c48f

Also make a PDF style variant using Adobe Source Serif/Sans/Code Pro
author Franz Glasner <fzglas.hg@dom66.de>
date Wed, 13 May 2026 09:48:52 +0200
parents 8825282f6900
children 156bcd310596
files docs/_latex/my-doc-fonts.sty docs/conf.py
diffstat 2 files changed, 49 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/docs/_latex/my-doc-fonts.sty	Wed May 13 09:47:12 2026 +0200
+++ b/docs/_latex/my-doc-fonts.sty	Wed May 13 09:48:52 2026 +0200
@@ -16,11 +16,13 @@
 
 \newif\if@mdf@WithDejaVuSansMono
 \newif\if@mdf@WithPlexMono
+\newif\if@mdf@WithAdobeSource
 
-\def\@mdf@reset@font@options{\@mdf@WithDejaVuSansMonofalse\@mdf@WithPlexMonofalse}
+\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}
 
 %
 % By default use the safe option dejavusansmono because is contains
@@ -70,4 +72,49 @@
     verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}%
     {sphinx}
 \fi
+\if@mdf@WithAdobeSource
+  \RequirePackage{newunicodechar}
+  \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}}
+  \setmainfont{Source Serif Pro}[
+    UprightFont = *,
+    BoldFont = * Bold,
+    ItalicFont = * Italic,
+    BoldItalicFont = * Bold Italic,
+  ]
+  \setsansfont{Source Sans Pro}[
+    UprightFont = *,
+    BoldFont = * Bold,
+    ItalicFont = * Italic,
+    BoldItalicFont = * Bold Italic,
+  ]
+  \setmonofont{Source Code Pro}[
+    UprightFont = *,
+    BoldFont = * Bold,
+    ItalicFont = * Italic,
+    BoldItalicFont = * Bold Italic,
+    Scale = MatchLowercase,
+  ]
+  \defaultfontfeatures{}
+  \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[%
+    UprightFont = *,
+    BoldFont = * Bold,
+    ItalicFont = * Oblique,
+    BoldItalicFont = * Bold Oblique,
+    Scale=MatchLowercase,
+    Ligatures=TeX,
+  ]
+  \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236
+  \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5
+  \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6
+  \newunicodechar{⟷}{{\DejaVuSansMono ⟷}}% U+27F7
+  \newunicodechar{⇒}{{\DejaVuSansMono ⇒}}% U+21D2
+  \newunicodechar{⇔}{{\DejaVuSansMono ⇔}}% U+21D4
+  \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F
+  \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208
+  \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C  
+  \PassOptionsToPackage{%
+    verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},%
+    verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}%
+    {sphinx}
+\fi
 \endinput
--- a/docs/conf.py	Wed May 13 09:47:12 2026 +0200
+++ b/docs/conf.py	Wed May 13 09:48:52 2026 +0200
@@ -147,6 +147,7 @@
     "papersize": "a4paper",
     "babel": r"\usepackage{babel}",
     "fontpkg": r"\usepackage[plexmono]{my-doc-fonts}",
+#    "fontpkg": r"\usepackage[adobesource]{my-doc-fonts}",
     "releasename": "Version",
 }
 latex_theme = "manual"