% !TeX TXS-program:compile = txs:///arara
% arara: lualatex: {shell: no, synctex: no, interaction: batchmode}

\documentclass{article}
\usepackage[margin=0.75in]{geometry}
\usepackage{fontspec}
\setmonofont{CMU Typewriter Text}
\usepackage{listings}
\usepackage{xcolor}
\setlength{\parindent}{0pt}

\newcommand\demotext{For \textsterling 45, almost anything can be found floating in fields.\\
	!`THE DAZED BROWN FOX QUICKLY GAVE 12345--67890 JUMPS!\\
	--- ?`But aren't Kafka's Schlo\ss{} and \AE sop's \OE uvres often na\"\i ve vis-\`a-vis the d\ae monic ph\oe nix's official r\^ole in fluffy souffl\'es?
}

%\newcommand*\demotextsc{\textsc{\ Sphinx of black quartz, judge my vow}.}

\begin{document}

\part*{cascadiamono-otf (v0.2)}

\section{Usage}

With \lstinline[language=TeX,basicstyle=\ttfamily]|\usepackage{fontspec}| (so with \lstinline[language=TeX,basicstyle=\ttfamily]|XeTeX| or \lstinline[language=TeX,basicstyle=\ttfamily]|LuaLaTeX| compilation), you can use \texttt{CascadiaCode} fonts, and \textit{remove} ligature's features, in order to use (in fact) \texttt{CascadiaMono} fonts.

\smallskip

The idea is to propose \texttt{fontspec} config files to load correctly \texttt{CascadiaMono} features.

\begin{lstlisting}[language={[latex]TeX},basicstyle=\footnotesize\ttfamily,commentstyle=\itshape\color{gray},keywordstyle=\color{magenta},tabsize=4,frame=single]
\usepackage{fontspec}
\setmonofont{CascadiaMono}[options]                %version regular
\setmonofont{CascadiaMono-SemiLight}[options]      %version semilight
\setmonofont{CascadiaMono-Light}[options]          %version light
\setmonofont{CascadiaMono-ExtraLight}[options]     %version extralight
\end{lstlisting}

\section{The default settings}

Following OpenType fonts are supported (it's based on \texttt{CascadiaCode} without the ligatures) :

\begin{lstlisting}[language={[latex]TeX},basicstyle=\footnotesize\ttfamily,commentstyle=\itshape\color{gray},keywordstyle=\color{magenta},tabsize=4,frame=single]
CascadiaCode-Bold.otf                      CascadiaCode-BoldItalic.otf
CascadiaCode-ExtraLight.otf                CascadiaCode-ExtraLightItalic.otf
CascadiaCode-Italic.otf                    CascadiaCode-Light.otf
CascadiaCode-LightItalic.otf               CascadiaCode-Regular.otf
CascadiaCode-SemiBold.otf                  CascadiaCode-SemiBoldItalic.otf
CascadiaCode-SemiLight.otf                 CascadiaCode-SemiLightItalic.otf
\end{lstlisting}

The \texttt{fontspec} config for the \textit{normal} version :

\begin{lstlisting}[language={[latex]TeX},basicstyle=\footnotesize\ttfamily,commentstyle=\itshape\color{gray},keywordstyle=\color{magenta},tabsize=4,frame=single]
\defaultfontfeatures[CascadiaMono]
    {Extension=.otf,
    UprightFont=CascadiaCode-Regular,
    ItalicFont=CascadiaCode-Italic,
    BoldFont=CascadiaCode-Bold,
    BoldItalicFont=CascadiaCode-BoldItalic,
    Contextuals=AlternateOff}
\end{lstlisting}

The \texttt{fontspec} config for the other versions are :

\begin{lstlisting}[language={[latex]TeX},basicstyle=\footnotesize\ttfamily,commentstyle=\itshape\color{gray},keywordstyle=\color{magenta},tabsize=4,frame=single]
\defaultfontfeatures[CascadiaMono-Light]
    {Extension=.otf,
    UprightFont=CascadiaCode-Light,
    ItalicFont=CascadiaCode-LightItalic,
    BoldFont=CascadiaCode-Regular,
    BoldItalicFont=CascadiaCode-Italic,
    Contextuals=AlternateOff}
\end{lstlisting}

\begin{lstlisting}[language={[latex]TeX},basicstyle=\footnotesize\ttfamily,commentstyle=\itshape\color{gray},keywordstyle=\color{magenta},tabsize=4,frame=single]
\defaultfontfeatures[CascadiaMono-SemiLight]
    {Extension=.otf,
    UprightFont=CascadiaCode-SemiLight,
    ItalicFont=CascadiaCode-SemiLightItalic,
    BoldFont=CascadiaCode-SemiBold,
    BoldItalicFont=CascadiaCode-SemiBoldItalic,
    Contextuals=AlternateOff}
\end{lstlisting}

\begin{lstlisting}[language={[latex]TeX},basicstyle=\footnotesize\ttfamily,commentstyle=\itshape\color{gray},keywordstyle=\color{magenta},tabsize=4,frame=single]
\defaultfontfeatures[CascadiaMono-ExtraLight]
    {Extension=.otf,
    UprightFont=CascadiaCode-ExtraLight,
    ItalicFont=CascadiaCode-ExtraLightItalic,
    BoldFont=CascadiaCode-SemiLight,
    BoldItalicFont=CascadiaCode-SemiLightItalic,
    Contextuals=AlternateOff}
\end{lstlisting}

\section{Font Samples}

\subsection{Normal version (Regular - Italic - Bold - BoldItalic)}

\setmonofont{CascadiaMono}[Scale=MatchLowercase]

\texttt{\demotext}\par\bigskip

\texttt{\textit{\demotext}}\par\bigskip

\texttt{\textbf{\demotext}}\par\bigskip

\texttt{\textbf{\textit{\demotext}}}\par

\subsection{SemiLight version (SemiLight - SemiLightItalic - SemiBold - SemiBoldItalic)}

\setmonofont{CascadiaMono-SemiLight}[Scale=MatchLowercase]

\texttt{\demotext}\par\bigskip

\texttt{\itshape\demotext}\par\bigskip

\texttt{\bfseries\demotext}\par\bigskip

\texttt{\bfseries\itshape\demotext}\par

\subsection{Light version (Light - LightItalic - Regular - Italic)}

\setmonofont{CascadiaMono-Light}[Scale=MatchLowercase]

\texttt{\demotext}\par\bigskip

\texttt{\itshape\demotext}\par\bigskip

\texttt{\bfseries\demotext}\par\bigskip

\texttt{\bfseries\itshape\demotext}\par

\subsection{ExtraLight version (ExtraLight - ExtraLightItalic - SemiLightItalic - SemiLightItalic)}

\setmonofont{CascadiaMono-ExtraLight}[Scale=MatchLowercase]

\texttt{\demotext}\par\bigskip

\texttt{\itshape\demotext}\par\bigskip

\texttt{\bfseries\demotext}\par\bigskip

\texttt{\bfseries\itshape\demotext}\par

\pagebreak

\section{Algorithm samples}

\subsection{Normal version}

\setmonofont{CascadiaMono}[Scale=MatchLowercase]

\begin{lstlisting}[language=python,basicstyle=\footnotesize\ttfamily,commentstyle=\itshape\color{gray},keywordstyle=\bfseries\color{magenta},tabsize=4,frame=single]
def Fibonacci(n) :
  # Check if input is 0 then it will print incorrect input
  if n < 0 :
    print("Incorrect input")
  elif n == 0 :
    return 0
  elif n == 1 or n == 2 :
    return 1
  else :
    return Fibonacci(n-1) + Fibonacci(n-2)
\end{lstlisting}

\subsection{SemiLight version}

\setmonofont{CascadiaMono-SemiLight}[Scale=MatchLowercase]

\begin{lstlisting}[language=python,basicstyle=\footnotesize\ttfamily,commentstyle=\itshape\color{gray},keywordstyle=\bfseries\color{magenta},tabsize=4,frame=single]
def Fibonacci(n) :
  # Check if input is 0 then it will print incorrect input
  if n < 0 :
    print("Incorrect input")
  elif n == 0 :
    return 0
  elif n == 1 or n == 2 :
    return 1
  else :
    return Fibonacci(n-1) + Fibonacci(n-2)
\end{lstlisting}

\subsection{Light version}

\setmonofont{CascadiaMono-Light}[Scale=MatchLowercase]

\begin{lstlisting}[language=python,basicstyle=\footnotesize\ttfamily,commentstyle=\itshape\color{gray},keywordstyle=\bfseries\color{magenta},tabsize=4,frame=single]
def Fibonacci(n) :
  # Check if input is 0 then it will print incorrect input
  if n < 0 :
    print("Incorrect input")
  elif n == 0 :
    return 0
  elif n == 1 or n == 2 :
    return 1
  else :
    return Fibonacci(n-1) + Fibonacci(n-2)
\end{lstlisting}

\subsection{ExtraLight version}

\setmonofont{CascadiaMono-ExtraLight}[Scale=MatchLowercase]

\begin{lstlisting}[language=python,basicstyle=\footnotesize\ttfamily,commentstyle=\itshape\color{gray},keywordstyle=\bfseries\color{magenta},tabsize=4,frame=single]
def Fibonacci(n) :
  # Check if input is 0 then it will print incorrect input
  if n < 0 :
    print("Incorrect input")
  elif n == 0 :
    return 0
  elif n == 1 or n == 2 :
    return 1
  else :
    return Fibonacci(n-1) + Fibonacci(n-2)
\end{lstlisting}

\pagebreak

\section{History}

\setmonofont{CMU Typewriter Text}[Scale=MatchLowercase]

\begin{verbatim}
v0.2 New weight options
v0.1 Initial version
\end{verbatim}

\end{document}
