% !TeX TXS-program:compile = txs:///arara % arara: lualatex: {shell: no, synctex: no, interaction: batchmode} \documentclass{article} \usepackage[margin=1in]{geometry} \usepackage{fontspec} \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} \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=TeX,basicstyle=\ttfamily,commentstyle=\itshape\color{gray},keywordstyle=\color{magenta},tabsize=4,frame=single] \usepackage{fontspec} \setmonofont{CascadiaMono}[options] %version regular \setmonofont{CascadiaMono-Light}[options] %version semilight \end{lstlisting} \section{The default settings} Following OpenType fonts are supported (it's based on CascadiaCode without the ligatures) : \begin{lstlisting}[language=TeX,basicstyle=\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=TeX,basicstyle=\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 \textit{semilight} version : \begin{lstlisting}[language=TeX,basicstyle=\ttfamily,commentstyle=\itshape\color{gray},keywordstyle=\color{magenta},tabsize=4,frame=single] \defaultfontfeatures[CascadiaMono-Light] {Extension=.otf, UprightFont=CascadiaCode-SemiLight, ItalicFont=CascadiaCode-SemiLightItalic, BoldFont=CascadiaCode-SemiBold, BoldItalicFont=CascadiaCode-SemiBoldItalic, Contextuals=AlternateOff } \end{lstlisting} \pagebreak \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-Light}[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=\ttfamily,commentstyle=\itshape\color{gray},keywordstyle=\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-Light}[Scale=MatchLowercase] \begin{lstlisting}[language=Python,basicstyle=\ttfamily,commentstyle=\itshape\color{gray},keywordstyle=\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} \vfill \section{History} \begin{verbatim} v0.1 Initial version \end{verbatim} \end{document}