blob: b4e467e9e370edd05f0c2c3a214e54f3d017cfe7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{CascadiaMonoPL}
[2023/09/26 (autoinst) Style file for CascadiaMonoPL fonts.]
\RequirePackage{xkeyval}
\newcommand*{\CascadiaMonoPL@scale}{1}
\DeclareOptionX{scale}{\renewcommand*{\CascadiaMonoPL@scale}{#1}}
\DeclareOptionX{scaled}{\renewcommand*{\CascadiaMonoPL@scale}{#1}}
\DeclareOptionX{lining}{\edef\CascadiaMonoPL@figurestyle{LF}}
\DeclareOptionX{tabular}{\edef\CascadiaMonoPL@figurealign{T}}
\DeclareOptionX{mainfont}{
\renewcommand{\familydefault}{\ttdefault}
}
\DeclareOptionX{semibold}{\edef\bfseries@tt{semibold}}
\DeclareOptionX{bold}{\edef\bfseries@tt{bold}}
\DeclareOptionX{regular}{\edef\mdseries@tt{regular}}
\ExecuteOptionsX{lining,tabular}
\ProcessOptionsX\relax
\RequirePackage{fontenc,textcomp}
\RequirePackage{ifthen}
\RequirePackage{mweights}
\IfFileExists{fontaxes.sty}{
\RequirePackage{fontaxes}
\fa@naming@exception{figures}{{superior}{proportional}}{Sup}
\fa@naming@exception{figures}{{superior}{tabular}}{Sup}
\def\supfigures{\@nomath\supfigures
\fontfigurestyle{superior}\selectfont}
\let\sufigures\supfigures
\DeclareTextFontCommand{\textsup}{\supfigures}
\let\textsu\textsup
\let\textsuperior\textsup
}{}
% Here we implement the scale=MatchLowercase option.
% If this is given, we must compute the correct value of
% the "\CascadiaMonoPL@scale" parameter before loading the .fd files;
% but to determine that value we of course need the font's x-height.
% To avoid triggering the loading of .fd files,
% we use plain TeX's \font primitive to load the testfont.
% We then compute the ratio of the current x-height to our font's x-height;
% this is the "\CascadiaMonoPL@scale" we will pass to the .fd files.
\ifthenelse{\equal{\CascadiaMonoPL@scale}{MatchLowercase}}
{ \newlength{\CascadiaMonoPL@currentx}
\settoheight{\CascadiaMonoPL@currentx}{x}
\newlength{\CascadiaMonoPL@xheight}
\settoheight{\CascadiaMonoPL@xheight}
{{\font\testfont=CascadiaMonoPL-Regular-tlf-ot1 at \f@size pt\testfont x}}
\renewcommand*{\CascadiaMonoPL@scale}
{\strip@pt\dimexpr\number\numexpr\number\dimexpr\CascadiaMonoPL@currentx\relax*65536/\number\dimexpr\CascadiaMonoPL@xheight\relax\relax sp\relax}}
{}
\renewcommand*
{\ttdefault}
{CascadiaMonoPL-\CascadiaMonoPL@figurealign\CascadiaMonoPL@figurestyle}
\endinput
|