summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/nunito/nunito.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-01-15 21:53:12 +0000
committerKarl Berry <karl@freefriends.org>2021-01-15 21:53:12 +0000
commitc69f39eefcd748e4f8400b6a50963fd60ca498e3 (patch)
treeb206387f4b14b1a2841e8898eb60ba0ac27c5ddd /Master/texmf-dist/tex/latex/nunito/nunito.sty
parent91c33b1407e62540d3dc7e38c92e666dfaa0c7ac (diff)
nunito (15jan21)
git-svn-id: svn://tug.org/texlive/trunk@57429 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/nunito/nunito.sty')
-rw-r--r--Master/texmf-dist/tex/latex/nunito/nunito.sty69
1 files changed, 69 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/nunito/nunito.sty b/Master/texmf-dist/tex/latex/nunito/nunito.sty
new file mode 100644
index 00000000000..85f11387f4b
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/nunito/nunito.sty
@@ -0,0 +1,69 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{nunito}
+ [2021/01/15 v.0.0.1 (Carl-Clemens Ebinger & autoinst) Style file for Nunito fonts.]
+
+\RequirePackage{xkeyval}
+\newcommand*{\Nunito@scale}{1}
+\DeclareOptionX{scale}{\renewcommand*{\Nunito@scale}{#1}}
+\DeclareOptionX{scaled}{\renewcommand*{\Nunito@scale}{#1}}
+
+\DeclareOptionX{lining}{\edef\Nunito@figurestyle{LF}}
+\DeclareOptionX{oldstyle}{\edef\Nunito@figurestyle{OsF}}
+\DeclareOptionX{tabular}{\edef\Nunito@figurealign{T}}
+\DeclareOptionX{mainfont}{
+ \renewcommand{\familydefault}{\rmdefault}
+}
+\DeclareOptionX{black}{\edef\bfseries@rm{black}}
+\DeclareOptionX{extrabold}{\edef\bfseries@rm{extrabold}}
+\DeclareOptionX{semibold}{\edef\bfseries@rm{semibold}}
+\DeclareOptionX{bold}{\edef\bfseries@rm{bold}}
+\DeclareOptionX{regular}{\edef\mdseries@rm{regular}}
+\ExecuteOptionsX{oldstyle,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 "\Nunito@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 "\Nunito@scale" we will pass to the .fd files.
+\ifthenelse{\equal{\Nunito@scale}{MatchLowercase}}
+ { \newlength{\Nunito@currentx}
+ \settoheight{\Nunito@currentx}{x}
+ \newlength{\Nunito@xheight}
+ \settoheight{\Nunito@xheight}
+ {{\font\testfont=Nunito-Regular-tosf-ot1 at \f@size pt\testfont x}}
+ \renewcommand*{\Nunito@scale}
+ {\strip@pt\dimexpr\number\numexpr\number\dimexpr\Nunito@currentx\relax*65536/\number\dimexpr\Nunito@xheight\relax\relax sp\relax}}
+ {}
+
+ \def\sufigures{\@nomath\sufigures\fontfigurestyle{superior}\selectfont}
+
+ \def\nunitotabular{\fontfamily{Nunito-TLF}\selectfont}
+%not defined. \def\nunitoproportional{\fontfamily{Nunito-LF}\selectfont}
+
+\renewcommand*
+ {\rmdefault}
+ {Nunito-\Nunito@figurealign\Nunito@figurestyle}
+
+
+\endinput