% -*- coding: utf-8 -*-
% SPDX-FileCopyrightText: © 2026 Franz Glasner
% SPDX-License-Identifier: BSD-3-Clause OR MIT
%
% Some font hacks for my Sphinx PDF documents.
% Needs a LaTeX environment with a working `fontspec' package.
%
% Options:
% - nomath:     Disable math support completely
% - noglobalunicodemath: Do not load unicode-math globally but only when
%                        really needed
% - fonts=<FONT>: Use font pairing named <FONT>. See the list below.
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{my-doc-fonts}[%
  2026/06/02 rv:c7ae4cfc2c5c (Franz Glasner) Fonts for Sphinx generated PDFs]
\RequirePackage{xkeyval}
\RequirePackage{fontspec}
\IfFileExists{xcolor.sty}{%
% Should Sphinx load xcolor with its dvipsnames and svgnames options?
    \RequirePackage{xcolor}
}{%
    \RequirePackage{color}
}

\newif\if@mdf@mono@dejavusansmono\@mdf@mono@dejavusansmonofalse
\newif\if@mdf@mono@cmmono\@mdf@mono@cmmonofalse
\newif\if@mdf@mono@robotomono\@mdf@mono@robotomonofalse
\newif\if@mdf@mono@sscode\@mdf@mono@sscodefalse
\newif\if@mdf@mono@inconsolata\@mdf@mono@inconsolatafalse
\newif\if@mdf@mono@libertinusmono\@mdf@mono@libertinusmonofalse
\newif\if@mdf@mono@hackmono\@mdf@mono@hackmonofalse
\newif\if@mdf@mono@firamono\@mdf@mono@firamonofalse
\newif\if@mdf@mono@firamonomedium\@mdf@mono@firamonomediumfalse
\newif\if@mdf@mono@gomono\@mdf@mono@gomonofalse
\newif\if@mdf@augment@cmutypewritertext\@mdf@augment@cmutypewritertextfalse
\newif\if@mdf@augment@libertinusmono\@mdf@augment@libertinusmonofalse
\newif\if@mdf@augment@ibmplexmono\@mdf@augment@ibmplexmonofalse
\newif\if@mdf@augment@redhatmono\@mdf@augment@redhatmonofalse
\newif\if@mdf@augment@cascadiacode\@mdf@augment@cascadiacodefalse
\newif\if@mdf@augment@jetbrainsmono\@mdf@augment@jetbrainsmonofalse
\newif\if@mdf@augment@firamono\@mdf@augment@firamonofalse
\newif\if@mdf@augment@gomono\@mdf@augment@gomonofalse

\newif\if@mdf@GlobalUnicodeMath\@mdf@GlobalUnicodeMathtrue
\DeclareOptionX{noglobalunicodemath}{\@mdf@GlobalUnicodeMathfalse}

\newif\if@mdf@UseUnicodeMath\@mdf@UseUnicodeMathtrue
\DeclareOptionX{nomath}{\@mdf@UseUnicodeMathfalse}

\newif\if@mdf@NeedUprightUnicodeMath\@mdf@NeedUprightUnicodeMathfalse

\newif\if@mdf@WithDejaVuSansMono
\newif\if@mdf@WithCM
\newif\if@mdf@WithIBMPlex
\newif\if@mdf@WithIBMPlexDejaVuSansMono
\newif\if@mdf@WithAdobeSourcePro
\newif\if@mdf@WithSpectral
\newif\if@mdf@WithCharter
\newif\if@mdf@WithLibertinus
\newif\if@mdf@WithGaramond
\newif\if@mdf@WithTufte
\newif\if@mdf@WithTufteHack
\newif\if@mdf@WithTufteFiraMono
\newif\if@mdf@WithPalatino
\newif\if@mdf@WithPalatinoKB
\newif\if@mdf@WithPalatinoRosario
\newif\if@mdf@WithCrimson
\newif\if@mdf@WithCrimsonCabin
\newif\if@mdf@WithDejaVu
\newif\if@mdf@WithMerriweather
\newif\if@mdf@WithLiterata
\newif\if@mdf@WithLiterataFiraMono
\newif\if@mdf@WithLiterataRobotoMono
\newif\if@mdf@WithVollkorn
\newif\if@mdf@WithErewhon
\newif\if@mdf@WithGentium
\newif\if@mdf@WithZillaSlab
\newif\if@mdf@WithAleo
\newif\if@mdf@WithLora
\newif\if@mdf@WithStix
\newif\if@mdf@WithBaskerville

% A key compatible with options processing as option "fonts" but choices.
\define@choicekey*{my-doc-fonts.sty}{fonts}[\val\nr]{%
  % do not change anything: just deactivate the default "dejavusansmono"
  default,
  % almost no augmentation needed: all characters available
  dejavusansmono,  % use DejaVu Sans Mono as monospaced font
  % the fonts below are augmented for missing characters
  cm,              % assume CM fonts and just fix missing characters
  ibmplex, plex,   % use the IBM Plex family (incl. Math)
  plex-dejavusansmono,  % use IBM Plex Serif/Sans and DejaVu Sans Mono
  adobesourcepro, adobesource,  % Use Adobe Source Serif/Sans/Mono
  spectral,        % use Spectral, Source Sans Pro and Source Code Pro
  charter,         % use XCharter (with XCharter Math), Lato and Inconsolata
  libertinus,      % use Libertinus family (incl. Math)
  garamond,        % EB Garamond (with Math), Libre Franklin and Inconsolata
  tufte,      % Tufte fonts: ETbb (with Math), GilliusADFNo2, DejaVu Sans Mono
  tufte-hack, % Tufte variant: ETbb (with Math), GilliusADFNo2, Hack
  tufte-firamono,  % Tufte variant: ETbb (with Math), GilliusADFNo2, Fira Mono
  palatino,        % Palatino, Inter and Source Code Pro
  palatino-kb,     % Palatino,  Lato and Inconsolata (original KB-Admin style)
  palatino-rosario,% Palatino,  Rosario and CMU Typewriter Text (Asana Math)
  crimson,    % Crimson Pro, (Intel) Clear Sans and Roboto Mono (Erewhon Math)
  crimson-cabin,   % Crimson Pro, Cabin and Source Code Pro (Erewhon Math)
  dejavu,          % All DejaVu fonts (Serif, Sans, Mono)
  merriweather,    % Merriweather, Merriweather Sans, Hack (Concrete Math)
  literata,            % Literata, Inter, IBM Plex Mono (Concrete Math)
  literata-firamono,   % Literata, Inter, Fira Mono Medium (Concrete Math)
  literata-robotomono, % Literata, Cabin, Roboto Mono (Concrete Math)
  vollkorn,        % Vollkorn, Jost, Red Hat Mono (STIX 2 Math)
  erewhon, utopia, % Erewhon, Rosario, XXX, (Erewhon Math)
  gentium,         % Gentium, Alegreya Sans, JetBrains Mono, (Euler Math)
  zillaslab,       % Zilla Slab, Metropolis, IBM Plex Mono Text, (Concrete Math)
  aleo,            % Aleo, Lato, IBM Plex Mono Text, (Euler Math)
  lora,            % Lora, Libre Franklin, Go Mono, (Asana Math)
  stix,            % STIX 2 Text, Inter, CMU Typewriter Text, (STIX 2 Math)
  baskerville,     % Libre Baskerville, Metropolis Medium, CMU Typewriter Text, (Euler Math)
  }{%
  % Not used for now : store the normalized option value (global and expanded)
  \xdef\@mdf@fonts{\val}%
  % Reset all option related font selection flags
  \@mdf@NeedUprightUnicodeMathfalse
  \@mdf@WithDejaVuSansMonofalse
  \@mdf@WithCMfalse
  \@mdf@WithIBMPlexfalse
  \@mdf@WithIBMPlexDejaVuSansMonofalse
  \@mdf@WithAdobeSourceProfalse
  \@mdf@WithSpectralfalse
  \@mdf@WithCharterfalse
  \@mdf@WithLibertinusfalse
  \@mdf@WithGaramondfalse
  \@mdf@WithTuftefalse
  \@mdf@WithTufteHackfalse
  \@mdf@WithTufteFiraMonofalse
  \@mdf@WithPalatinofalse
  \@mdf@WithPalatinoKBfalse
  \@mdf@WithPalatinoRosariofalse
  \@mdf@WithCrimsonfalse
  \@mdf@WithCrimsonCabinfalse
  \@mdf@WithDejaVufalse
  \@mdf@WithMerriweatherfalse
  \@mdf@WithLiteratafalse
  \@mdf@WithLiterataFiraMonofalse
  \@mdf@WithLiterataRobotoMonofalse
  \@mdf@WithVollkornfalse
  \@mdf@WithErewhonfalse
  \@mdf@WithGentiumfalse
  \@mdf@WithZillaSlabfalse
  \@mdf@WithAleofalse
  \@mdf@WithLorafalse
  \@mdf@WithStixfalse
  \@mdf@WithBaskervillefalse
  % Now set the needed font selection flag
  \ifcase\nr\relax
    \relax
  \or
    \@mdf@WithDejaVuSansMonotrue
  \or
    \@mdf@WithCMtrue
  \or
    \@mdf@WithIBMPlextrue
  \or
    \@mdf@WithIBMPlextrue
    % Normalize the stored string
    \gdef\@mdf@fonts{ibmplex}
  \or
    \@mdf@WithIBMPlexDejaVuSansMonotrue
  \or
    \@mdf@WithAdobeSourceProtrue
  \or
    \@mdf@WithAdobeSourceProtrue
    % Normalize the stored string
    \gdef\@mdf@fonts{adobesourcepro}
  \or
   \@mdf@WithSpectraltrue
  \or
    \@mdf@WithChartertrue
  \or
    \@mdf@WithLibertinustrue
  \or
    \@mdf@WithGaramondtrue
  \or
    \@mdf@WithTuftetrue
  \or
    \@mdf@WithTufteHacktrue
  \or
    \@mdf@WithTufteFiraMonotrue
  \or
    \@mdf@WithPalatinotrue
  \or
    \@mdf@WithPalatinoKBtrue
  \or
    \@mdf@WithPalatinoRosariotrue
  \or
    \@mdf@WithCrimsontrue
  \or
    \@mdf@WithCrimsonCabintrue
  \or
    \@mdf@WithDejaVutrue
  \or
    \@mdf@WithMerriweathertrue
  \or
    \@mdf@WithLiteratatrue
  \or
    \@mdf@WithLiterataFiraMonotrue
  \or
    \@mdf@WithLiterataRobotoMonotrue
  \or
    \@mdf@WithVollkorntrue
  \or
    \@mdf@WithErewhontrue
  \or
    \@mdf@WithErewhontrue
    % Normalize the stored string
    \gdef\@mdf@fonts{erewhon}
  \or
    \@mdf@WithGentiumtrue
    \@mdf@NeedUprightUnicodeMathtrue
  \or
    \@mdf@WithZillaSlabtrue
  \or
    \@mdf@WithAleotrue
    \@mdf@NeedUprightUnicodeMathtrue
  \or
    \@mdf@WithLoratrue
  \or
    \@mdf@WithStixtrue
  \or
    \@mdf@WithBaskervilletrue
    \@mdf@NeedUprightUnicodeMathtrue
  \fi
}

%
% By default use the safe option dejavusansmono because is contains
% all characters without any hacks.
%
\ExecuteOptionsX{fonts=dejavusansmono}
\ProcessOptionsX\relax

\if@mdf@UseUnicodeMath
  \if@mdf@GlobalUnicodeMath
    \if@mdf@NeedUprightUnicodeMath
      \RequirePackage[math-style=upright]{unicode-math}
    \else
      \RequirePackage{unicode-math}
    \fi
  \fi
\fi

\if@mdf@WithDejaVuSansMono
  % default but with DejaVu Sans Mono as monospaced font
  %\RequirePackage[DefaultFeatures={Scale=0.92},mono=false]{plex-otf}
  %\RequirePackage[mono=true,serif=false,sans=false,math=false]{dejavu-otf}  % all symbols are available
  \@mdf@mono@dejavusansmonotrue
  \fi

\if@mdf@WithCM
  \@mdf@mono@cmmonotrue
\fi

\if@mdf@WithIBMPlex
  \if@mdf@UseUnicodeMath
    \RequirePackage[%
      DefaultFeatures={Scale=0.92},
      RMSCfont={},% disable default SC font which uses TeX Gyre Termes
      RM={%
        %SmallCapsFont=XCharter-Roman,
        SmallCapsFont=SourceSerifPro-Regular,%
        SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.05},%
        %BoldFeatures={SmallCapsFont=XCharter-Bold},%
        BoldFeatures={SmallCapsFont=SourceSerifPro-Bold},%
        %ItalicFeatures={SmallCapsFont=XCharter-Italic},%
        ItalicFeatures={SmallCapsFont=SourceSerifPro-RegularIt},%
      },
      SSSCfont={},% disable default SC font which uses TeX Gyre Heros
      SS={%
        SmallCapsFont=SourceSansPro-Regular,%
        SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.05},%
        BoldFeatures={SmallCapsFont=SourceSansPro-Bold},%
        ItalicFeatures={SmallCapsFont=SourceSansPro-RegularIt},%
      },%
      math=true]{plex-otf}
  \else
    \RequirePackage[%
      DefaultFeatures={Scale=0.92},
      RMSCfont={},% disable default SC font which uses TeX Gyre Termes
      RM={%
        SmallCapsFont=SourceSerifPro-Regular,%
        SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.05},%
        BoldFeatures={SmallCapsFont=SourceSerifPro-Bold},%
        ItalicFeatures={SmallCapsFont=SourceSerifPro-RegularIt},%
      },
      SSSCfont={},% disable default SC font which uses TeX Gyre Heros
      SS={%
        SmallCapsFont=SourceSansPro-Regular,%
        SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.05},%
        BoldFeatures={SmallCapsFont=SourceSansPro-Bold},%
        ItalicFeatures={SmallCapsFont=SourceSansPro-RegularIt},%
      },%
      math=false]{plex-otf}
  \fi
  \@mdf@augment@ibmplexmonotrue
\fi

\if@mdf@WithIBMPlexDejaVuSansMono
  \if@mdf@UseUnicodeMath
    \RequirePackage[%
      DefaultFeatures={Scale=0.92},
      RMSCfont={},% disable default SC font which uses TeX Gyre Termes
      RM={%
        SmallCapsFont=SourceSerifPro-Regular,%
        SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.05},%
        BoldFeatures={SmallCapsFont=SourceSerifPro-Bold},%
        ItalicFeatures={SmallCapsFont=SourceSerifPro-RegularIt},%
      },%
      SSSCfont={},% disable default SC font which uses TeX Gyre Heros
      SS={%
        SmallCapsFont=SourceSansPro-Regular,%
        SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.05},%
        BoldFeatures={SmallCapsFont=SourceSansPro-Bold},%
        ItalicFeatures={SmallCapsFont=SourceSansPro-RegularIt},%
      },%
      mono=false]{plex-otf}
  \else
    \RequirePackage[%
      DefaultFeatures={Scale=0.92},
      RMSCfont={},% disable default SC font which uses TeX Gyre Termes
      RM={%
        SmallCapsFont=SourceSerifPro-Regular,%
        SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.05},%
        BoldFeatures={SmallCapsFont=SourceSerifPro-Bold},%
        ItalicFeatures={SmallCapsFont=SourceSerifPro-RegularIt},%
      },%
      SSSCfont={},% disable default SC font which uses TeX Gyre Heros
      SS={%
        SmallCapsFont=SourceSansPro-Regular,%
        SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.05},%
        BoldFeatures={SmallCapsFont=SourceSansPro-Bold},%
        ItalicFeatures={SmallCapsFont=SourceSansPro-RegularIt},%
      },%
      mono=false,%
      math=false]{plex-otf}
  \fi
  \@mdf@mono@dejavusansmonotrue
\fi

\if@mdf@WithAdobeSourcePro
  \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi
  \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,
  ]
  \if@mdf@UseUnicodeMath
    \defaultfontfeatures{}
    \setmathfont{XCharter Math}[%
      Scale = MatchLowercase,
    ]
  \fi
  \@mdf@mono@sscodetrue
\fi

\if@mdf@WithSpectral
  \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi
  \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}}
  \setmainfont{Spectral}[
    UprightFont = * Regular,
    BoldFont = * Bold,
    ItalicFont = * Italic,
    BoldItalicFont = * Bold Italic,
  ]
  \setsansfont{Source Sans Pro}[
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Italic,
    BoldItalicFont = * Bold Italic,
  ]
  \if@mdf@UseUnicodeMath
    \setmathfont{STIX Two Math}[Scale=MatchLowercase]
  \fi
  \@mdf@mono@sscodetrue
\fi

\if@mdf@WithCharter
  \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}}
  \RequirePackage{xcharter-otf}% ALWAYS loads also XCharter Math
  \defaultfontfeatures{}% Reset from package
  \setsansfont{Lato}[
    UprightFont = * Regular,
    BoldFont = * Bold,
    ItalicFont = * Italic,
    BoldItalicFont = * Bold Italic,
    Scale = MatchLowercase,
    Numbers = {Lining, Tabular},
    Ligatures = TeX,
  ]
  \@mdf@mono@inconsolatatrue
\fi

\if@mdf@WithLibertinus
  \RequirePackage{newunicodechar}
  \if@mdf@UseUnicodeMath
    \RequirePackage[lining,tabular]{libertinus-otf}
    \defaultfontfeatures{}% Reset from package
    \setmathfont{Asana Math}[range={"2713,"2AB7,"22D0},Scale=MatchLowercase]
    \setmathfont{Libertinus Math}[range={},Scale=MatchLowercase]
  \else
    \RequirePackage[lining,tabular,nomath]{libertinus-otf}
  \fi
  \@mdf@augment@libertinusmonotrue
\fi

\if@mdf@WithGaramond
  \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi
  \RequirePackage[lining,tabular]{ebgaramond}
  \defaultfontfeatures{}% Reset from package
  \if@mdf@UseUnicodeMath
    \setmathfont{Garamond-Math}[Scale=MatchLowercase]
    \setmathfont{Asana Math}[range={"2713},Scale=MatchLowercase]
    \setmathfont{Garamond-Math}[range={},Scale=MatchLowercase]
  \fi
  \setsansfont{Libre Franklin}[Scale=MatchLowercase,Ligatures=TeX,Numbers={Lining,Tabular}]
  \@mdf@mono@inconsolatatrue
\fi

\if@mdf@WithTufteHack
  \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi
  \defaultfontfeatures{Numbers={Lining,Tabular},Ligatures=TeX}
  \setmainfont{ETbb}
  \setsansfont{GilliusADFNo2}[Scale=MatchLowercase]
  \if@mdf@UseUnicodeMath
    \setmathfont{Libertinus Math}[Scale=MatchLowercase]
    \setmathfont{Asana Math}[range={"2713,"2AB7,"22D0},Scale=MatchLowercase]
    \setmathfont{Libertinus Math}[range={},Scale=MatchLowercase]
  \fi
  \@mdf@mono@hackmonotrue
\fi

\if@mdf@WithTufteFiraMono
  \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi
  \defaultfontfeatures{Numbers={Lining,Tabular},Ligatures=TeX}
  \setmainfont{ETbb}
  \setsansfont{GilliusADFNo2}[Scale=MatchLowercase]
  \if@mdf@UseUnicodeMath
    \setmathfont{Libertinus Math}[Scale=MatchLowercase]
    \setmathfont{Asana Math}[range={"2713,"2AB7,"22D0},Scale=MatchLowercase]
    \setmathfont{Libertinus Math}[range={},Scale=MatchLowercase]
  \fi
  \@mdf@mono@firamonotrue
\fi

\if@mdf@WithTufte
  \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi
  \defaultfontfeatures{Numbers={Lining,Tabular},Ligatures=TeX}
  \setmainfont{ETbb}
  \setsansfont{GilliusADFNo2}[Scale=MatchLowercase]
  \if@mdf@UseUnicodeMath
    \setmathfont{Libertinus Math}[Scale=MatchLowercase]
    \setmathfont{Asana Math}[range={"2713,"2AB7,"22D0},Scale=MatchLowercase]
    \setmathfont{Libertinus Math}[range={},Scale=MatchLowercase]
  \fi
  \@mdf@mono@dejavusansmonotrue
\fi

\if@mdf@WithPalatino
  \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi
  \linespread{1.06}
  \defaultfontfeatures{Numbers={Lining,Tabular},Ligatures=TeX}
  \setmainfont{TeXGyrePagellaX}
  \setsansfont{Inter}[Scale=MatchLowercase]
  %\setsansfont{Rosario}[Scale=MatchLowercase,ScaleAgain=1.013]
  %\setmathfont{Asana Math}[Scale=MatchLowercase]
  \if@mdf@UseUnicodeMath
    \setmathfont{TeX Gyre Pagella Math}[Scale=MatchLowercase]
    \setmathfont{Asana Math}[range={"2AB7},Scale=MatchLowercase]
    \setmathfont{TeX Gyre Pagella Math}[range={},Scale=MatchLowercase]
  \fi
  %\@mdf@mono@sscodetrue
  \@mdf@mono@libertinusmonotrue
\fi

\if@mdf@WithPalatinoKB
  \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi
  \linespread{1.06}
  \defaultfontfeatures{Numbers={Lining,Tabular},Ligatures=TeX}
  \setmainfont{TeXGyrePagellaX}
  \setsansfont{Lato}[%
    UprightFont = * Regular,
    BoldFont = * Bold,
    ItalicFont = * Italic,
    BoldItalicFont = * Bold Italic,
    Scale=MatchLowercase]
  %\setsansfont{Rosario}[Scale=MatchLowercase,ScaleAgain=1.013]
  %\setmathfont{Asana Math}[Scale=MatchLowercase]
  \if@mdf@UseUnicodeMath
    \setmathfont{TeX Gyre Pagella Math}[Scale=MatchLowercase]
    \setmathfont{Asana Math}[range={"2AB7},Scale=MatchLowercase]
    \setmathfont{TeX Gyre Pagella Math}[range={},Scale=MatchLowercase]
  \fi
  \@mdf@mono@inconsolatatrue
\fi

\if@mdf@WithPalatinoRosario
  \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi
  \linespread{1.06}
  \defaultfontfeatures{Numbers={Lining,Tabular},Ligatures=TeX}
  \setmainfont{TeXGyrePagellaX}
  \defaultfontfeatures{Scale=MatchLowercase}
  \setsansfont{Rosario}[%
    UprightFont = * Regular,
    BoldFont = * Bold,
    ItalicFont = * Italic,
    BoldItalicFont = * Bold Italic,
  ]
  \setmonofont{CMU Typewriter Text}
  \if@mdf@UseUnicodeMath
    \setmathfont{Asana Math}[Scale=MatchLowercase]
  \fi
  \@mdf@augment@cmutypewritertexttrue
\fi

\if@mdf@WithCrimson
  \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi
  \defaultfontfeatures{Ligatures=TeX, Numbers={Lining,Tabular}}
  \setmainfont{Crimson Pro}[%
    SmallCapsFont = Erewhon Regular,
    SmallCapsFeatures = {Letters = SmallCaps, Scale = MatchLowercase},
    BoldFeatures = {SmallCapsFont = Erewhon Bold},
    ItalicFeatures = {SmallCapsFont = Erewhon Italic},
  ]
  %\setsansfont{Open Sans}[Scale=MatchLowercase]
  \setsansfont{Clear Sans}[Scale=MatchLowercase]
  \if@mdf@UseUnicodeMath
    \defaultfontfeatures{}% Erewhon Math needs this here!
    \setmathfont{Erewhon Math}[Scale=MatchLowercase]
  \fi
  %\@mdf@mono@sscodetrue
  %\@mdf@mono@inconsolatatrue
  \@mdf@mono@robotomonotrue
\fi

\if@mdf@WithCrimsonCabin
  \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi
  \defaultfontfeatures{Ligatures=TeX, Numbers={Lining,Tabular}}
  \setmainfont{Crimson Pro}[%
    SmallCapsFont = Erewhon Regular,
    SmallCapsFeatures = {Letters=SmallCaps, Scale=MatchLowercase},
    BoldFeatures = {SmallCapsFont = Erewhon Bold},
    ItalicFeatures = {SmallCapsFont = Erewhon Italic},
  ]
  \setsansfont{Cabin}[Scale=MatchLowercase]
  \if@mdf@UseUnicodeMath
    \defaultfontfeatures{}% Erewhon Math needs this here!
    \setmathfont{Erewhon Math}[Scale=MatchLowercase]
  \fi
  %\@mdf@mono@sscodetrue
  \@mdf@mono@inconsolatatrue
\fi

\if@mdf@WithDejaVu
  \RequirePackage{newunicodechar}
  % automatically applied with Scale=MatchLowercase,...
  \if@mdf@UseUnicodeMath
    \RequirePackage[%
      RM={%
        Scale = 0.92,% as in dejavu-otf
        SmallCapsFont = {XCharter-Roman.otf},%
        SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.12},%
        ItalicFeatures = {SmallCapsFont = {XCharter-Italic.otf}},%
        BoldFeatures = {SmallCapsFont = {XCharter-Bold.otf}},%
        BoldItalicFeatures = {SmallCapsFont = {XCharter-BoldItalic.otf}},%
      },%
      SS={Scale = 0.92},%
      mono=true,serif=true,sans=true,math=true]{dejavu-otf}
      \setmathfont{XCharter Math}[range={"2713,"2AB7},Scale=MatchLowercase]
      \setmathfont{DejaVu Math TeX Gyre}[range={},Scale=MatchLowercase]
      %\setmathfont{DejaVu Math TeX Gyre}[range={},version=normal]
      %\setmathfont{DejaVu Math TeX Gyre}[range={},FakeBold=3,version=bold]
  \else
    \RequirePackage[%
      RM={%
        Scale = 0.92,% as in dejavu-otf
        SmallCapsFont = {XCharter-Roman.otf},%
        SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.12}},%
        ItalicFeatures = {SmallCapsFont = {XCharter-Italic.otf}},%
        BoldFeatures = {SmallCapsFont = {XCharter-Bold.otf}},%
        BoldItalicFeatures = {SmallCapsFont = {XCharter-BoldItalic.otf}},%
      },%
      SS={Scale = 0.92},%
      mono=true,serif=true,sans=true,math=false]{dejavu-otf}
  \fi
  \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387
  %
  % Try to fix for missing \mathrm:
  % https://tex.stackexchange.com/questions/669382/latex-error-math-alphabet-identifier-mathrm-is-undefined-in-math-version
  %
  % DOES NOT WORK!
  %\mathversion{normal}\let\mathrm\symup
  % THIS WORKS (see also unicode-math.pdf Section 4.4.3 Operator font):
  \if@mdf@UseUnicodeMath
    \setoperatorfont\symup
  \fi
\fi

\if@mdf@WithMerriweather
  \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi
  \linespread{1.06}
  \defaultfontfeatures{%
    Scale = 0.92,
    Ligatures = TeX,
    Numbers = {Lining,Tabular},
    Extension = .otf,
  }
  \setmainfont{Merriweather}[%
    UprightFont = *-Regular ,
    ItalicFont = *-Italic ,
    BoldFont = *-Bold ,
    BoldItalicFont = *-BoldItalic
  ]
  \setsansfont{MerriweatherSans}[%
    UprightFont = *-Regular ,
    ItalicFont = *-Italic ,
    BoldFont = *-Bold ,
    BoldItalicFont = *-BoldItalic
  ]
  \if@mdf@UseUnicodeMath
    \defaultfontfeatures{Scale=MatchLowercase}
    \RequirePackage[no-text]{concmath-otf}% for concmath-otf
  \fi
  \@mdf@mono@hackmonotrue
\fi

\if@mdf@WithLiterata
  \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi
  \defaultfontfeatures{%
    Ligatures = TeX,
    Numbers = {Lining,Tabular},
  }
  \setmainfont{Literata}
  \setsansfont{Inter}[Scale=MatchLowercase]
  \setmonofont{IBMPlexMono}[%
    Scale = MatchLowercase,
    Extension = .otf,
    UprightFont= *-Regular,
    BoldFont = *-Bold,
    ItalicFont = *-Italic,
    BoldItalicFont = *-BoldItalic,
    SlantedFont = *-Italic,
  ]
  \if@mdf@UseUnicodeMath
    \defaultfontfeatures{Scale=MatchLowercase}% for concmath-otf and Plex Mono
    \RequirePackage[no-text]{concmath-otf}
  \fi
  \@mdf@augment@ibmplexmonotrue
\fi

\if@mdf@WithLiterataFiraMono
  \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi
  \defaultfontfeatures{%
    Ligatures = TeX,
    Numbers = {Lining,Tabular},
  }
  \setmainfont{Literata}
  \defaultfontfeatures{Scale=MatchLowercase, Ligatures=TeX}
  \setsansfont{Inter}
  \if@mdf@UseUnicodeMath
    \defaultfontfeatures{Scale=MatchLowercase}
    \RequirePackage[no-text]{concmath-otf}% for concmath-otf
  \fi
  \@mdf@mono@firamonomediumtrue
\fi

\if@mdf@WithLiterataRobotoMono
  \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi
  \defaultfontfeatures{%
    Ligatures = TeX,
    Numbers = {Lining,Tabular},
  }
  \setmainfont{Literata}
  \setsansfont{Cabin}[Scale=MatchLowercase]
  \if@mdf@UseUnicodeMath
    \defaultfontfeatures{Scale=MatchLowercase}
    \RequirePackage[no-text]{concmath-otf}% for concmath-otf
  \fi
  \@mdf@mono@robotomonotrue
\fi

\if@mdf@WithVollkorn
  \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi
  \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}}
  \setmainfont{Vollkorn}[
    UprightFont = * Regular,
    BoldFont = * Bold,
    ItalicFont = * Italic,
    BoldItalicFont = * Bold Italic,
  ]
  \setsansfont{Jost}[%
    Scale = MatchLowercase,
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Italic,
    BoldItalicFont = * Bold Italic,
  ]
  \setmonofont{CascadiaMono}[Scale=MatchLowercase]
  \if@mdf@UseUnicodeMath
    \defaultfontfeatures{Scale=MatchLowercase}
    \setmathfont{STIX Two Math}
  \fi
  \@mdf@augment@cascadiacodetrue
\fi

\if@mdf@WithErewhon
  \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi
  \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}}
  \setmainfont{Erewhon}[
    UprightFont = * Regular,
    BoldFont = * Bold,
    ItalicFont = * Italic,
    BoldItalicFont = * Bold Italic,
  ]
  \setsansfont{Rosario}[%
    Scale = MatchLowercase,
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Italic,
    BoldItalicFont = * Bold Italic,
  ]
  \if@mdf@UseUnicodeMath
    \defaultfontfeatures{Scale=MatchLowercase}
    \setmathfont{Erewhon Math}
  \fi
  \@mdf@mono@hackmonotrue
\fi

\if@mdf@WithGentium
  \if@mdf@UseUnicodeMath\RequirePackage[math-style=upright]{unicode-math}\fi
  \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}}
  \setmainfont{Gentium}[
    UprightFont = * Regular,
    BoldFont = * Bold,
    ItalicFont = * Italic,
    BoldItalicFont = * Bold Italic,
  ]
  \setsansfont{Alegreya Sans}[%
    Scale = MatchLowercase,
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Italic,
    BoldItalicFont = * Bold Italic,
  ]
  \setmonofont{JetBrains Mono}[Scale=MatchLowercase]
  \if@mdf@UseUnicodeMath
    \RequirePackage[Scale=MatchLowercase]{euler-math}
    \defaultfontfeatures{Scale=MatchLowercase}
    \setmathfont{XCharter Math}[range={"03F1,"1D71A}]
    \setmathfont{Euler Math}[range={}]
    %\setmathfont{Euler Math}
    %\renewcommand{\varrho}{\rho}
    %\renewcommand{\rho}{\mbfsansrho}
  \fi
  \@mdf@augment@jetbrainsmonotrue
\fi

\if@mdf@WithZillaSlab
  \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi
  \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}}
  \setmainfont{Zilla Slab}[
    UprightFont = * Regular,
    BoldFont = * Bold,
    ItalicFont = * Italic,
    BoldItalicFont = * Bold Italic,
  ]
  \setsansfont{Metropolis}[%
    Scale=MatchLowercase,
    UprightFont = * Regular,
    BoldFont = * Bold,
    ItalicFont = * Regular Italic,
    BoldItalicFont = * Bold Italic,
  ]
%  \defaultfontfeatures{Scale=MatchLowercase}
%  \setmonofont{JetBrains Mono}[%
%    Ligatures = TeX
  %  ]
  \setmonofont{IBMPlexMonoText}[%
    Scale=MatchLowercase,
    Extension = .otf,
    UprightFont= IBMPlexMono-Text,
    BoldFont = IBMPlexMono-Bold,
    ItalicFont = IBMPlexMono-TextItalic,
    BoldItalicFont = IBMPlexMono-BoldItalic,
    SlantedFont = IBMPlexMono-TextItalic,
  ]
  \@mdf@augment@ibmplexmonotrue

  \if@mdf@UseUnicodeMath
    \defaultfontfeatures{Scale=MatchLowercase}
    \RequirePackage[no-text]{concmath-otf}% for concmath-otf
  \fi
  %\@mdf@augment@jetbrainsmonotrue
\fi

\if@mdf@WithAleo
  \if@mdf@UseUnicodeMath\RequirePackage[math-style=upright]{unicode-math}\fi
  \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}}
  \setmainfont{Aleo}[
    Extension = .ttf,
    UprightFont = {Aleo-VariableFont_wght} ,
    UprightFeatures = {Instance = Regular} ,
    ItalicFont = {Aleo-Italic-VariableFont_wght} ,
    ItalicFeatures = {Instance = Italic} ,
    BoldFont = {Aleo-VariableFont_wght} ,
    BoldFeatures = {Instance = Bold} ,
    BoldItalicFont = {Aleo-Italic-VariableFont_wght} ,
    BoldItalicFeatures = {Instance = {Bold Italic}} ,
    SmallCapsFont = {ZillaSlab-Medium.otf} ,
    SmallCapsFeatures = {Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.1} ,
    ItalicFeatures = {SmallCapsFont = {ZillaSlab-MediumItalic.otf}} ,
    BoldFeatures = {SmallCapsFont = {ZillaSlab-Bold.otf}} ,
  ]
  \setsansfont{Lato}[%
    Scale = MatchLowercase,
    UprightFont = * Regular,
    BoldFont = * Bold,
    ItalicFont = * Italic,
    BoldItalicFont = * Bold Italic,
  ]
  \setmonofont{IBMPlexMonoText}[%
    Scale = MatchLowercase,
    Extension = .otf,
    UprightFont= IBMPlexMono-Text,
    BoldFont = IBMPlexMono-Bold,
    ItalicFont = IBMPlexMono-TextItalic,
    BoldItalicFont = IBMPlexMono-BoldItalic,
    SlantedFont = IBMPlexMono-TextItalic,
  ]
  \@mdf@augment@ibmplexmonotrue

  \if@mdf@UseUnicodeMath
    \defaultfontfeatures{}
    \RequirePackage[Scale=MatchLowercase]{euler-math}
    \setmathfont{XCharter Math}[range={"03F1,"1D71A},Scale=MatchLowercase]
    \setmathfont{Euler Math}[range={},Scale=MatchLowercase]
  \fi
\fi

\if@mdf@WithLora
  \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi
  \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}}
  \linespread{1.02}
  \setmainfont{Lora}[%
    Scale = 0.98,
    UprightFont = * Regular,
    BoldFont = * Bold,
    ItalicFont = * Italic,
    BoldItalicFont = * Bold Italic,
    SmallCapsFont = {STIX Two Text},
    SmallCapsFeatures={Letters=SmallCaps, Scale=MatchLowercase, ScaleAgain=1.05},
    BoldFeatures={SmallCapsFont={STIX Two Text Bold}},
    ItalicFeatures={SmallCapsFont={STIX Two Text Italic}},
    BoldItalicFeatures={SmallCapsFont={STIX Two Text Bold Italic}},
  ]
  \setsansfont{Libre Franklin}[Scale=MatchLowercase]
  \if@mdf@UseUnicodeMath
    \defaultfontfeatures{Scale=MatchLowercase}
    \setmathfont{Asana Math}
  \fi
  %\@mdf@mono@libertinusmonotrue
  \@mdf@mono@gomonotrue
\fi

\if@mdf@WithBaskerville
  \if@mdf@UseUnicodeMath\RequirePackage[math-style=upright]{unicode-math}\fi
  \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}}
  \linespread{1.02}
  \setmainfont{Libre Baskerville}[%
    Scale=0.92,
    UprightFont = * Regular,
    BoldFont = * Bold,
    ItalicFont = * Italic,
    %BoldItalicFont = * Bold Italic,   % no bold italic font for Baskerville
    SmallCapsFont = {Erewhon Regular},
    SmallCapsFeatures={%
      Letters = SmallCaps,
      Scale = MatchLowercase,
      ScaleAgain=1.16
    },
    BoldFeatures={SmallCapsFont={Erewhon Bold}},
    ItalicFeatures={SmallCapsFont={Erewhon Italic}},
    BoldItalicFeatures={SmallCapsFont={Erewhon Bold Italic}},
  ]
  \setsansfont{Metropolis}[%
    Scale = MatchLowercase,
    UprightFont= * Medium,
    ItalicFont = * Medium Italic,
    BoldFont = * Bold,
    BoldItalicFont = * Bold Italic,
  ]
  \setmonofont{CMU Typewriter Text}[%
    Scale = MatchLowercase,
    ScaleAgain = 0.98,
  ]
  \if@mdf@UseUnicodeMath
    \defaultfontfeatures{}
    \RequirePackage[Scale=MatchLowercase]{euler-math}
    \defaultfontfeatures{Scale=MatchLowercase}
    \setmathfont{XCharter Math}[range={"03F1,"1D71A}]
    \setmathfont{Euler Math}[range={}]
  \fi
  \@mdf@augment@cmutypewritertexttrue
\fi

\if@mdf@WithStix
  \if@mdf@UseUnicodeMath\RequirePackage{unicode-math}\fi
  \defaultfontfeatures{Ligatures=TeX,Numbers={Lining,Tabular}}
  \setmainfont{STIX Two Text}[%
    UprightFont = * Regular,
    BoldFont = * Bold,
    ItalicFont = * Italic,
    BoldItalicFont = * Bold Italic,
  ]
  \setsansfont{Inter}[Scale=MatchLowercase]
  \setmonofont{CMU Typewriter Text}[Scale=MatchLowercase]
  \if@mdf@UseUnicodeMath
    \defaultfontfeatures{Scale=MatchLowercase}
    \setmathfont{STIX Two Math}
  \fi
  \@mdf@augment@cmutypewritertexttrue
\fi

%
% MONO
%

% Used for most
\defaultfontfeatures{%
  Scale=MatchLowercase,
  Ligatures=TeX,
  Numbers={Lining,Tabular}
}

\if@mdf@mono@dejavusansmono
  \RequirePackage{newunicodechar}
  % automatically applied with Scale=MatchLowercase,...
  \defaultfontfeatures{%
    Ligatures=TeX,
    Numbers={Lining,Tabular}
  }
  \RequirePackage[mono=true,serif=false,sans=false,math=false]{dejavu-otf}  % almost all symbols are available
  \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387
\fi

\if@mdf@mono@cmmono
  \RequirePackage{newunicodechar}
  \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newunicodechar{▷}{{\DejaVuSansMono ▷}}% U+25B7
  \newunicodechar{▹}{{\DejaVuSansMono ▹}}% U+25B9
  \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236
  \newunicodechar{◆}{{\DejaVuSansMono ◆}}% U+25C6
  \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5
  \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6
  \newunicodechar{⟷}{{\DejaVuSansMono ⟷}}% U+27F7
  \newunicodechar{⇒}{{\DejaVuSansMono ⇒}}% U+21D2
  \newunicodechar{⇔}{{\DejaVuSansMono ⇔}}% U+21D4
  \newunicodechar{▪}{{\DejaVuSansMono ▪}}% U+25AA
  \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F
  \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208
  \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C
  \newunicodechar{≠}{{\DejaVuSansMono ≠}}% U+2260
  \newunicodechar{≤}{{\DejaVuSansMono ≤}}% U+2264
  \newunicodechar{≥}{{\DejaVuSansMono ≥}}% U+2265
  \newunicodechar{≙}{{\DejaVuSansMono ≙}}% U+2259
  \newunicodechar{↪}{{\DejaVuSansMono ↪}}% U+21AA
  \newunicodechar{↩}{{\DejaVuSansMono ↩}}% U+21A9
  \newunicodechar{⇧}{{\DejaVuSansMono ⇧}}% U+21E7
  \newunicodechar{⌃}{{\DejaVuSansMono ⌃}}% U+2303
  \newunicodechar{⎈}{{\DejaVuSansMono ⎈}}% U+2388
  \newunicodechar{⌥}{{\DejaVuSansMono ⌥}}% U+2325
  \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387
  \newunicodechar{⌘}{{\DejaVuSansMono ⌘}}% U+2318
  \newunicodechar{⏏}{{\DejaVuSansMono ⏏}}% U+23CF
  \newunicodechar{⌫}{{\DejaVuSansMono ⌫}}% U+232B
  \newunicodechar{⌦}{{\DejaVuSansMono ⌦}}% U+2326
  \newunicodechar{⇥}{{\DejaVuSansMono ⇥}}% U+21E5
  \newunicodechar{⇤}{{\DejaVuSansMono ⇤}}% U+21E4
  \PassOptionsToPackage{%
    verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},%
    verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}%
    {sphinx}
\fi

\if@mdf@mono@sscode
  \RequirePackage{newunicodechar}
  \setmonofont{Source Code Pro}[
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Italic,
    BoldItalicFont = * Bold Italic,
  ]
  \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \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
  \newunicodechar{≙}{{\DejaVuSansMono ≙}}% U+2259
  \newunicodechar{␣}{{\DejaVuSansMono ␣}}% U+2423
  \newunicodechar{↪}{{\DejaVuSansMono ↪}}% U+21AA
  \newunicodechar{↩}{{\DejaVuSansMono ↩}}% U+21A9
  \newunicodechar{⇧}{{\DejaVuSansMono ⇧}}% U+21E7
  \newunicodechar{⌃}{{\DejaVuSansMono ⌃}}% U+2303
  \newunicodechar{⎈}{{\DejaVuSansMono ⎈}}% U+2388
  \newunicodechar{⌥}{{\DejaVuSansMono ⌥}}% U+2325
  \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387
  \newunicodechar{⌘}{{\DejaVuSansMono ⌘}}% U+2318
  \newunicodechar{⏏}{{\DejaVuSansMono ⏏}}% U+23CF
  \newunicodechar{⌫}{{\DejaVuSansMono ⌫}}% U+232B
  \newunicodechar{⌦}{{\DejaVuSansMono ⌦}}% U+2326
  \newunicodechar{⇥}{{\DejaVuSansMono ⇥}}% U+21E5
  \newunicodechar{⇤}{{\DejaVuSansMono ⇤}}% U+21E4
  \PassOptionsToPackage{%
    verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},%
    verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}%
    {sphinx}
\fi

\if@mdf@mono@inconsolata
  \RequirePackage{newunicodechar}
  \setmonofont{Inconsolata LGC Nerd Font Mono}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Italic,
    BoldItalicFont = * Bold Italic,
  ]
  \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newunicodechar{▹}{{\DejaVuSansMono ▹}}% U+25B9
  \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236
  \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5
  \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6
  \newunicodechar{⟷}{{\DejaVuSansMono ⟷}}% U+27F7
  \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F
  \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208
  \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C
  \newunicodechar{≙}{{\DejaVuSansMono ≙}}% U+2259
  \newunicodechar{↪}{{\DejaVuSansMono ↪}}% U+21AA
  \newunicodechar{↩}{{\DejaVuSansMono ↩}}% U+21A9
  \newunicodechar{⇧}{{\DejaVuSansMono ⇧}}% U+21E7
  \newunicodechar{⌃}{{\DejaVuSansMono ⌃}}% U+2303
  \newunicodechar{⎈}{{\DejaVuSansMono ⎈}}% U+2388
  \newunicodechar{⌥}{{\DejaVuSansMono ⌥}}% U+2325
  \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387
  \newunicodechar{⌘}{{\DejaVuSansMono ⌘}}% U+2318
  \newunicodechar{⏏}{{\DejaVuSansMono ⏏}}% U+23CF
  \newunicodechar{⌫}{{\DejaVuSansMono ⌫}}% U+232B
  \newunicodechar{⌦}{{\DejaVuSansMono ⌦}}% U+2326
  \newunicodechar{⇥}{{\DejaVuSansMono ⇥}}% U+21E5
  \newunicodechar{⇤}{{\DejaVuSansMono ⇤}}% U+21E4

  %\RequirePackage{pifont}
  %\newunicodechar{✓}{\ding{51}}

  %\newunicodechar{✓}{{\DejaVuSansMono ✓}}% U+2713
\fi

\if@mdf@mono@robotomono
  \RequirePackage{newunicodechar}
  \setmonofont{Roboto Mono}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Italic,
    BoldItalicFont = * Bold Italic,
  ]
  \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newunicodechar{▷}{{\DejaVuSansMono ▷}}% U+25B7
  \newunicodechar{▹}{{\DejaVuSansMono ▹}}% U+25B9
  \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236
  \newunicodechar{◆}{{\DejaVuSansMono ◆}}% U+25C6
  \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5
  \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6
  \newunicodechar{⟷}{{\DejaVuSansMono ⟷}}% U+27F7
  \newunicodechar{⇒}{{\DejaVuSansMono ⇒}}% U+21D2
  \newunicodechar{⇔}{{\DejaVuSansMono ⇔}}% U+21D4
  \newunicodechar{▪}{{\DejaVuSansMono ▪}}% U+25AA
  \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F
  \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208
  \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C
  \newunicodechar{≙}{{\DejaVuSansMono ≙}}% U+2259
  \newunicodechar{␣}{{\DejaVuSansMono ␣}}% U+2423
  \newunicodechar{↪}{{\DejaVuSansMono ↪}}% U+21AA
  \newunicodechar{↩}{{\DejaVuSansMono ↩}}% U+21A9
  \newunicodechar{⇧}{{\DejaVuSansMono ⇧}}% U+21E7
  \newunicodechar{⌃}{{\DejaVuSansMono ⌃}}% U+2303
  \newunicodechar{⎈}{{\DejaVuSansMono ⎈}}% U+2388
  \newunicodechar{⌥}{{\DejaVuSansMono ⌥}}% U+2325
  \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387
  \newunicodechar{⌘}{{\DejaVuSansMono ⌘}}% U+2318
  \newunicodechar{⏏}{{\DejaVuSansMono ⏏}}% U+23CF
  \newunicodechar{⌫}{{\DejaVuSansMono ⌫}}% U+232B
  \newunicodechar{⌦}{{\DejaVuSansMono ⌦}}% U+2326
  \newunicodechar{⇥}{{\DejaVuSansMono ⇥}}% U+21E5
  \newunicodechar{⇤}{{\DejaVuSansMono ⇤}}% U+21E4
  \PassOptionsToPackage{%
    verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},%
    verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}%
    {sphinx}
\fi

\if@mdf@mono@hackmono
  \RequirePackage{newunicodechar}
  \setmonofont{Hack}
  \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newunicodechar{␣}{{\DejaVuSansMono ␣}}% U+2423
  \newunicodechar{⌃}{{\DejaVuSansMono ⌃}}% U+2303
  \newunicodechar{⎈}{{\DejaVuSansMono ⎈}}% U+2388
  \newunicodechar{⌥}{{\DejaVuSansMono ⌥}}% U+2325
  \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387
  \newunicodechar{⌘}{{\DejaVuSansMono ⌘}}% U+2318
  \newunicodechar{⏏}{{\DejaVuSansMono ⏏}}% U+23CF
  \newunicodechar{⌫}{{\DejaVuSansMono ⌫}}% U+232B
  \newunicodechar{⌦}{{\DejaVuSansMono ⌦}}% U+2326
  \newunicodechar{✓}{{\DejaVuSansMono ✓}}% U+2713
  \PassOptionsToPackage{%
    verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},%
    verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}%
    {sphinx}
\fi

\if@mdf@mono@firamono
  \setmonofont{Fira Mono}[%
    UprightFont = * Regular,
    ItalicFont = * Oblique,
    BoldFont = * Bold,
    BoldItalicFont = * Bold Oblique,
  ]
  \@mdf@augment@firamonotrue
\fi

\if@mdf@mono@firamonomedium
  \setmonofont{Fira Mono}[%
    UprightFont = * Medium,
    ItalicFont = * Medium Oblique,
    BoldFont = * Bold,
    BoldItalicFont = * Bold Oblique,
  ]
  \@mdf@augment@firamonotrue
\fi

\if@mdf@mono@libertinusmono
  \defaultfontfeatures{}
  % This is stolen from libertinus-otf.sty!
  \setmonofont{LibertinusMono}[%
    Ligatures = TeX,
    Numbers = {Lining, Tabular},
    Scale = MatchLowercase,
    FakeStretch = 0.94,
    UprightFont = *-Regular,
    ItalicFont = *-Regular,
    ItalicFeatures = {FakeSlant=0.2},
    SlantedFont = *-Regular,
    SlantedFeatures= {FakeSlant=0.2},
    BoldFont = *-Regular,
    BoldFeatures = {RawFeature={embolden=3}},
    BoldItalicFont = *-Regular,
    BoldItalicFeatures={FakeSlant=0.2,RawFeature={embolden=3}},
    Extension      = .otf,
  ]
  \@mdf@augment@libertinusmonotrue
\fi

\if@mdf@mono@gomono
  \setmonofont{Go Mono}[ScaleAgain  = 0.95]
  \@mdf@augment@gomonotrue
\fi

%
% AUGMENT
%

% Used for all below
\defaultfontfeatures{%
  Scale=MatchLowercase,
  Ligatures=TeX,
  Numbers={Lining,Tabular}
}

\if@mdf@augment@ibmplexmono
  \RequirePackage{newunicodechar}
  \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newunicodechar{▷}{{\DejaVuSansMono ▷}}% U+25B7
  \newunicodechar{▹}{{\DejaVuSansMono ▹}}% U+25B9
  \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236
  \newunicodechar{◆}{{\DejaVuSansMono ◆}}% U+25C6
  \newunicodechar{▪}{{\DejaVuSansMono ▪}}% U+25AA
  \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
  \newunicodechar{≙}{{\DejaVuSansMono ≙}}% U+2259
  \newunicodechar{␣}{{\DejaVuSansMono ␣}}% U+2423
  \newunicodechar{⇧}{{\DejaVuSansMono ⇧}}% U+21E7
  \newunicodechar{⌃}{{\DejaVuSansMono ⌃}}% U+2303
  \newunicodechar{⎈}{{\DejaVuSansMono ⎈}}% U+2388
  \newunicodechar{⌥}{{\DejaVuSansMono ⌥}}% U+2325
  \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387
  \newunicodechar{⌘}{{\DejaVuSansMono ⌘}}% U+2318
  \newunicodechar{⏏}{{\DejaVuSansMono ⏏}}% U+23CF
  \newunicodechar{⌫}{{\DejaVuSansMono ⌫}}% U+232B
  \newunicodechar{⌦}{{\DejaVuSansMono ⌦}}% U+2326
  \newunicodechar{⇥}{{\DejaVuSansMono ⇥}}% U+21E5
  \newunicodechar{⇤}{{\DejaVuSansMono ⇤}}% U+21E4
  %\newunicodechar{^^^^2423}{{\DejaVuSansMono^^^^2423}}% U+2423
  %\newunicodechar{␣}{\textvisiblespace}% U+2423
  %\catcode`^^^^2423\active\protected\def^^^^2423{\textvisiblespace}

  \PassOptionsToPackage{%
    verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},%
    verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}%
    {sphinx}
\fi

\if@mdf@augment@libertinusmono
  \RequirePackage{newunicodechar}
  \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newunicodechar{▷}{{\DejaVuSansMono ▷}}% U+25B7
  \newunicodechar{▹}{{\DejaVuSansMono ▹}}% U+25B9
  \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236
  \newunicodechar{◆}{{\DejaVuSansMono ◆}}% U+25C6
  \newunicodechar{▪}{{\DejaVuSansMono ▪}}% U+25AA
  \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
  \newunicodechar{≠}{{\DejaVuSansMono ≠}}% U+2260
  \newunicodechar{≤}{{\DejaVuSansMono ≤}}% U+2264
  \newunicodechar{≥}{{\DejaVuSansMono ≥}}% U+2265
  \newunicodechar{≙}{{\DejaVuSansMono ≙}}% U+2259
  \newunicodechar{␣}{{\DejaVuSansMono ␣}}% U+2423
  \newunicodechar{↪}{{\DejaVuSansMono ↪}}% U+21AA
  \newunicodechar{↩}{{\DejaVuSansMono ↩}}% U+21A9
  \newunicodechar{⇧}{{\DejaVuSansMono ⇧}}% U+21E7
  \newunicodechar{⌃}{{\DejaVuSansMono ⌃}}% U+2303
  \newunicodechar{⎈}{{\DejaVuSansMono ⎈}}% U+2388
  \newunicodechar{⌥}{{\DejaVuSansMono ⌥}}% U+2325
  \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387
  \newunicodechar{⌘}{{\DejaVuSansMono ⌘}}% U+2318
  \newunicodechar{⏏}{{\DejaVuSansMono ⏏}}% U+23CF
  \newunicodechar{⌫}{{\DejaVuSansMono ⌫}}% U+232B
  \newunicodechar{⌦}{{\DejaVuSansMono ⌦}}% U+2326
  \newunicodechar{⇥}{{\DejaVuSansMono ⇥}}% U+21E5
  \newunicodechar{⇤}{{\DejaVuSansMono ⇤}}% U+21E4
  \newunicodechar{✓}{{\DejaVuSansMono ✓}}% U+2713
  %\newunicodechar{^^^^2423}{{\DejaVuSansMono^^^^2423}}% U+2423
  %\newunicodechar{␣}{\textvisiblespace}% U+2423
  %\catcode`^^^^2423\active\protected\def^^^^2423{\textvisiblespace}

  \PassOptionsToPackage{%
    verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},%
    verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}%
    {sphinx}
\fi

\if@mdf@augment@redhatmono
  \RequirePackage{newunicodechar}
  \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newunicodechar{▷}{{\DejaVuSansMono ▷}}% U+25B7
  \newunicodechar{▹}{{\DejaVuSansMono ▹}}% U+25B9
  \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236
  \newunicodechar{◆}{{\DejaVuSansMono ◆}}% U+25C6
  \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5
  \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6
  \newunicodechar{⟷}{{\DejaVuSansMono ⟷}}% U+27F7
  \newunicodechar{⇒}{{\DejaVuSansMono ⇒}}% U+21D2
  \newunicodechar{⇔}{{\DejaVuSansMono ⇔}}% U+21D4
  \newunicodechar{▪}{{\DejaVuSansMono ▪}}% U+25AA
  \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F
  \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208
  \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C
%  \newunicodechar{≠}{{\DejaVuSansMono ≠}}% U+2260
  \newunicodechar{≤}{{\DejaVuSansMono ≤}}% U+2264
  \newunicodechar{≥}{{\DejaVuSansMono ≥}}% U+2265
  \newunicodechar{≙}{{\DejaVuSansMono ≙}}% U+2259
  \newunicodechar{␣}{{\DejaVuSansMono ␣}}% U+2423
  \newunicodechar{↪}{{\DejaVuSansMono ↪}}% U+21AA
  \newunicodechar{↩}{{\DejaVuSansMono ↩}}% U+21A9
  \newunicodechar{⇧}{{\DejaVuSansMono ⇧}}% U+21E7
  \newunicodechar{⌃}{{\DejaVuSansMono ⌃}}% U+2303
  \newunicodechar{⎈}{{\DejaVuSansMono ⎈}}% U+2388
  \newunicodechar{⌥}{{\DejaVuSansMono ⌥}}% U+2325
  \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387
  \newunicodechar{⌘}{{\DejaVuSansMono ⌘}}% U+2318
  \newunicodechar{⏏}{{\DejaVuSansMono ⏏}}% U+23CF
  \newunicodechar{⌫}{{\DejaVuSansMono ⌫}}% U+232B
  \newunicodechar{⌦}{{\DejaVuSansMono ⌦}}% U+2326
  \newunicodechar{⇥}{{\DejaVuSansMono ⇥}}% U+21E5
  \newunicodechar{⇤}{{\DejaVuSansMono ⇤}}% U+21E4
  \PassOptionsToPackage{%
    verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},%
    verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}%
    {sphinx}
\fi

\if@mdf@augment@cascadiacode
  \RequirePackage{newunicodechar}
  \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \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
  \newunicodechar{≙}{{\DejaVuSansMono ≙}}% U+2259
  \newunicodechar{␣}{{\DejaVuSansMono ␣}}% U+2423
  \newunicodechar{↪}{{\DejaVuSansMono ↪}}% U+21AA
  \newunicodechar{↩}{{\DejaVuSansMono ↩}}% U+21A9
  \newunicodechar{⇧}{{\DejaVuSansMono ⇧}}% U+21E7
  \newunicodechar{⌃}{{\DejaVuSansMono ⌃}}% U+2303
  \newunicodechar{⎈}{{\DejaVuSansMono ⎈}}% U+2388
  \newunicodechar{⌥}{{\DejaVuSansMono ⌥}}% U+2325
  \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387
  \newunicodechar{⌘}{{\DejaVuSansMono ⌘}}% U+2318
  \newunicodechar{⏏}{{\DejaVuSansMono ⏏}}% U+23CF
  \newunicodechar{⌫}{{\DejaVuSansMono ⌫}}% U+232B
  \newunicodechar{⌦}{{\DejaVuSansMono ⌦}}% U+2326
  \newunicodechar{⇥}{{\DejaVuSansMono ⇥}}% U+21E5
  \newunicodechar{⇤}{{\DejaVuSansMono ⇤}}% U+21E4
  \PassOptionsToPackage{%
    verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},%
    verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}%
    {sphinx}
\fi

\if@mdf@augment@jetbrainsmono
  \RequirePackage{newunicodechar}
  \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newunicodechar{≙}{{\DejaVuSansMono ≙}}% U+2259
  \newunicodechar{⎈}{{\DejaVuSansMono ⎈}}% U+2388
  \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387
  \newunicodechar{⏏}{{\DejaVuSansMono ⏏}}% U+23CF
  \newunicodechar{⇥}{{\DejaVuSansMono ⇥}}% U+21E5
  \newunicodechar{⇤}{{\DejaVuSansMono ⇤}}% U+21E4
%  \PassOptionsToPackage{%
%    verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},%
%    verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}%
%    {sphinx}
\fi

\if@mdf@augment@firamono
  \RequirePackage{newunicodechar}
  \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newunicodechar{▷}{{\DejaVuSansMono ▷}}% U+25B7
  \newunicodechar{▹}{{\DejaVuSansMono ▹}}% U+25B9
  \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
  \newunicodechar{␣}{{\DejaVuSansMono ␣}}% U+2423
  \newunicodechar{↪}{{\DejaVuSansMono ↪}}% U+21AA
  \newunicodechar{↩}{{\DejaVuSansMono ↩}}% U+21A9
  \newunicodechar{≙}{{\DejaVuSansMono ≙}}% U+2259
  \newunicodechar{⌃}{{\DejaVuSansMono ⌃}}% U+2303
  \newunicodechar{⎈}{{\DejaVuSansMono ⎈}}% U+2388
  \newunicodechar{⌥}{{\DejaVuSansMono ⌥}}% U+2325
  \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387
  \newunicodechar{⌘}{{\DejaVuSansMono ⌘}}% U+2318
  \newunicodechar{⏏}{{\DejaVuSansMono ⏏}}% U+23CF
  \newunicodechar{⇥}{{\DejaVuSansMono ⇥}}% U+21E5
  \newunicodechar{⇤}{{\DejaVuSansMono ⇤}}% U+21E4
  \newunicodechar{✓}{{\DejaVuSansMono ✓}}% U+2713

  \PassOptionsToPackage{%
    verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},%
    verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}%
    {sphinx}
\fi

\if@mdf@augment@cmutypewritertext
  \RequirePackage{newunicodechar}
  \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newunicodechar{▷}{{\DejaVuSansMono ▷}}% U+25B7
  \newunicodechar{▹}{{\DejaVuSansMono ▹}}% U+25B9
  \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236
  \newunicodechar{◆}{{\DejaVuSansMono ◆}}% U+25C6
  \newunicodechar{▪}{{\DejaVuSansMono ▪}}% U+25AA
  \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5
  \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6
  \newunicodechar{⟷}{{\DejaVuSansMono ⟷}}% U+27F7
  \newunicodechar{⇒}{{\DejaVuSansMono ⇒}}% U+21D2
  \newunicodechar{⇔}{{\DejaVuSansMono ⇔}}% U+21D4
  \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208
  \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C
  \newunicodechar{≠}{{\DejaVuSansMono ≠}}% U+2260
  \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F
  \newunicodechar{␣}{{\DejaVuSansMono ␣}}% U+2423
  \newunicodechar{↪}{{\DejaVuSansMono ↪}}% U+21AA
  \newunicodechar{↩}{{\DejaVuSansMono ↩}}% U+21A9
  \newunicodechar{≤}{{\DejaVuSansMono ≤}}% U+2264
  \newunicodechar{≥}{{\DejaVuSansMono ≥}}% U+2265
  \newunicodechar{≙}{{\DejaVuSansMono ≙}}% U+2259
  \newunicodechar{⇧}{{\DejaVuSansMono ⇧}}% U+21E7
  \newunicodechar{⌃}{{\DejaVuSansMono ⌃}}% U+2303
  \newunicodechar{⎈}{{\DejaVuSansMono ⎈}}% U+2388
  \newunicodechar{⌥}{{\DejaVuSansMono ⌥}}% U+2325
  \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387
  \newunicodechar{⌘}{{\DejaVuSansMono ⌘}}% U+2318
  \newunicodechar{⏏}{{\DejaVuSansMono ⏏}}% U+23CF
  \newunicodechar{⌫}{{\DejaVuSansMono ⌫}}% U+232B
  \newunicodechar{⌦}{{\DejaVuSansMono ⌦}}% U+2326
  \newunicodechar{⇥}{{\DejaVuSansMono ⇥}}% U+21E5
  \newunicodechar{⇤}{{\DejaVuSansMono ⇤}}% U+21E4
\fi

\if@mdf@augment@gomono
  \RequirePackage{newunicodechar}
  \newfontfamily\DejaVuSansMono{DejaVu Sans Mono}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newfontfamily\DejaVuSansCondensed{DejaVu Sans Condensed}[%
    UprightFont = *,
    BoldFont = * Bold,
    ItalicFont = * Oblique,
    BoldItalicFont = * Bold Oblique,
  ]
  \newunicodechar{▷}{{\DejaVuSansMono ▷}}% U+25B7
  \newunicodechar{▹}{{\DejaVuSansMono ▹}}% U+25B9
  \newunicodechar{∶}{{\DejaVuSansMono ∶}}% U+2236
  \newunicodechar{◆}{{\DejaVuSansMono ◆}}% U+25C6
  \newunicodechar{⟵}{{\DejaVuSansMono ⟵}}% U+27F5
  \newunicodechar{⟶}{{\DejaVuSansMono ⟶}}% U+27F6
  \newunicodechar{⟷}{{\DejaVuSansMono ⟷}}% U+27F7
  \newunicodechar{⇒}{{\DejaVuSansMono ⇒}}% U+21D2
  \newunicodechar{⇔}{{\DejaVuSansMono ⇔}}% U+21D4
  \newunicodechar{∈}{{\DejaVuSansMono ∈}}% U+2208
  \newunicodechar{∌}{{\DejaVuSansMono ∌}}% U+220C
  \newunicodechar{≠}{{\DejaVuSansMono ≠}}% U+2260
  \newunicodechar{≟}{{\DejaVuSansMono ≟}}% U+225F
  \newunicodechar{␣}{{\DejaVuSansMono ␣}}% U+2423
  \newunicodechar{↪}{{\DejaVuSansMono ↪}}% U+21AA
  \newunicodechar{↩}{{\DejaVuSansMono ↩}}% U+21A9
  \newunicodechar{≤}{{\DejaVuSansMono ≤}}% U+2264
  \newunicodechar{≥}{{\DejaVuSansMono ≥}}% U+2265
  \newunicodechar{≙}{{\DejaVuSansMono ≙}}% U+2259
  \newunicodechar{⇧}{{\DejaVuSansMono ⇧}}% U+21E7
  \newunicodechar{⌃}{{\DejaVuSansMono ⌃}}% U+2303
  \newunicodechar{⎈}{{\DejaVuSansMono ⎈}}% U+2388
  \newunicodechar{⌥}{{\DejaVuSansMono ⌥}}% U+2325
  \newunicodechar{⎇}{{\DejaVuSansCondensed ⎇}}% U+2387
  \newunicodechar{⌘}{{\DejaVuSansMono ⌘}}% U+2318
  \newunicodechar{⏏}{{\DejaVuSansMono ⏏}}% U+23CF
  \newunicodechar{⌫}{{\DejaVuSansMono ⌫}}% U+232B
  \newunicodechar{⌦}{{\DejaVuSansMono ⌦}}% U+2326
  \newunicodechar{⇥}{{\DejaVuSansMono ⇥}}% U+21E5
  \newunicodechar{⇤}{{\DejaVuSansMono ⇤}}% U+21E4

  \PassOptionsToPackage{%
    verbatimvisiblespace={\textcolor{red}{{\DejaVuSansMono^^^^2423}}},%
    verbatimcontinued={\textcolor{red}{{\DejaVuSansMono^^^^21aa}}}}%
    {sphinx}
\fi

\defaultfontfeatures{}

\def\testmdf{
  Normalized: \@mdf@fonts\newline
}

\endinput
