diff options
author | Karl Berry <karl@freefriends.org> | 2013-11-05 01:09:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-11-05 01:09:35 +0000 |
commit | 7dac886f64c886bd3d674eb018c25b8a7bbd1c98 (patch) | |
tree | dd9c94fc47430a49d2e97c385c9da4da9a09d15d /Master/texmf-dist/tex/latex/mintspirit/mintspirit2.sty | |
parent | 79c300296bbe7c12c60b394dc5f3f861b176cfa3 (diff) |
mintspirit (4nov13)
git-svn-id: svn://tug.org/texlive/trunk@32069 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/mintspirit/mintspirit2.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/mintspirit/mintspirit2.sty | 268 |
1 files changed, 268 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/mintspirit/mintspirit2.sty b/Master/texmf-dist/tex/latex/mintspirit/mintspirit2.sty new file mode 100644 index 00000000000..e6e37ae40ea --- /dev/null +++ b/Master/texmf-dist/tex/latex/mintspirit/mintspirit2.sty @@ -0,0 +1,268 @@ +\ProvidesPackage{mintspirit2}[% + 2013/11/02 (Bob Tennent) Supports MintSpiritNoTwo fonts for all LaTeX engines. ] + +\RequirePackage{ifxetex,ifluatex,textcomp} + +\newif\ifmintspirit@otf + +\ifxetex + \mintspirit@otftrue +\else\ifluatex + \mintspirit@otftrue +\else % [pdf]LaTeX + \mintspirit@otffalse +\fi\fi + +\newif\ifmintspirit@default \mintspirit@defaultfalse +\newif\ifmintspirit@lining \mintspirit@liningfalse +\newif\ifmintspirit@tabular \mintspirit@tabularfalse + +\newcommand*{\MintSpiritNoTwo@scale}{1} +\RequirePackage{xkeyval} +\DeclareOptionX{scaled}{\renewcommand*{\MintSpiritNoTwo@scale}{#1}} +\DeclareOptionX{scale}{\renewcommand*{\MintSpiritNoTwo@scale}{#1}} + +\DeclareOptionX{type1}{\mintspirit@otffalse} + +\DeclareOptionX{default}{\mintspirit@defaulttrue} +\DeclareOptionX{sfdefault}{\mintspirit@defaulttrue} + +\DeclareOptionX{lining}[true]{% +\@nameuse{if#1}% + \mintspirit@liningtrue +\else + mintspirit@liningfalse +\fi +} +\DeclareOptionX{lf}[true]{% +\@nameuse{if#1}% + \mintspirit@liningtrue +\else + mintspirit@liningfalse +\fi +} +\DeclareOptionX{oldstyle}[true]{% +\@nameuse{if#1}% + \mintspirit@liningfalse +\else + \mintspirit@liningtrue +\fi +} + +\DeclareOptionX{osf}[true]{% +\@nameuse{if#1}% + \mintspirit@liningfalse +\else + \mintspirit@liningtrue +\fi +} + +\DeclareOptionX{tabular}[true]{% +\@nameuse{if#1}% + \mintspirit@tabulartrue +\else + mintspirit@tabularfalse +\fi +} + +\DeclareOptionX{tab}[true]{% +\@nameuse{if#1}% + \mintspirit@tabulartrue +\else + mintspirit@tabularfalse +\fi +} + +\DeclareOptionX{proportional}[true]{% +\@nameuse{if#1}% + \mintspirit@tabularfalse +\else + \mintspirit@tabulartrue +\fi +} + +\DeclareOptionX{prop}[true]{% +\@nameuse{if#1}% + \mintspirit@tabularfalse +\else + \mintspirit@tabulartrue +\fi +} + +\ProcessOptionsX\relax + + +\ifmintspirit@otf + \RequirePackage{fontspec} +\else + \RequirePackage{fontenc,fontaxes} +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% for some reason, Tabular Lining <-> Proportional Lining !! % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\ifmintspirit@otf + + \ifxetex\XeTeXtracingfonts=1\fi + \defaultfontfeatures{ + Ligatures = TeX , + Extension = .otf , + Scale = \MintSpiritNoTwo@scale , + } + + \ifmintspirit@lining + \ifmintspirit@tabular + \setsansfont + [ Numbers = {Proportional,Lining}, + UprightFont = *-Regular , + ItalicFont = *-Italic , + BoldFont = *-Bold , + BoldItalicFont = *-BoldItalic ] + {MintSpiritNo2} + \else + \setsansfont + [ Numbers = {Monospaced,Lining}, + UprightFont = *-Regular , + ItalicFont = *-Italic , + BoldFont = *-Bold , + BoldItalicFont = *-BoldItalic ] + {MintSpiritNo2} + \fi + \else + \ifmintspirit@tabular + \setsansfont + [ Numbers = {Monospaced,OldStyle}, + UprightFont = *-Regular , + ItalicFont = *-Italic , + BoldFont = *-Bold , + BoldItalicFont = *-BoldItalic ] + {MintSpiritNo2} + \else + \setsansfont + [ Numbers = {Proportional,OldStyle}, + UprightFont = *-Regular , + ItalicFont = *-Italic , + BoldFont = *-Bold , + BoldItalicFont = *-BoldItalic ] + {MintSpiritNo2} + \fi + \fi + + % grab current family in case of subsequent change: + \let\mintspiritfamily\sfdefault + \ifmintspirit@default\renewcommand*\familydefault{\mintspiritfamily}\fi + + \newfontfamily\tlstyle + [ Numbers = {Proportional,Lining}, + UprightFont = *-Regular , + ItalicFont = *-Italic , + BoldFont = *-Bold , + BoldItalicFont = *-BoldItalic ] + {MintSpiritNo2} + + \newfontfamily\tostyle + [ Numbers = {Monospaced,OldStyle}, + UprightFont = *-Regular , + ItalicFont = *-Italic , + BoldFont = *-Bold , + BoldItalicFont = *-BoldItalic ] + {MintSpiritNo2} + + \newfontfamily\plstyle + [ Numbers = {Monospaced,Lining}, + UprightFont = *-Regular , + ItalicFont = *-Italic , + BoldFont = *-Bold , + BoldItalicFont = *-BoldItalic ] + {MintSpiritNo2} + + \newfontfamily\postyle + [ Numbers = {Proportional,OldStyle}, + UprightFont = *-Regular , + ItalicFont = *-Italic , + BoldFont = *-Bold , + BoldItalicFont = *-BoldItalic ] + {MintSpiritNo2} + + + \providecommand\useosf{% + \defaultfontfeatures{ + Ligatures = TeX , + Extension = .otf , + Scale = \MintSpiritNoTwo@scale , + } + \ifmintspirit@tabular + \setsansfont + [ Numbers = {Monospaced,OldStyle}, + UprightFont = *-Regular , + ItalicFont = *-Italic , + BoldFont = *-Bold , + BoldItalicFont = *-BoldItalic ] + {MintSpiritNo2} + \else + \setsansfont + [ Numbers = {Proportional,OldStyle}, + UprightFont = *-Regular , + ItalicFont = *-Italic , + BoldFont = *-Bold , + BoldItalicFont = *-BoldItalic ] + {MintSpiritNo2} + \fi + \defaultfontfeatures{} + } + + \providecommand\sufigures{\addfontfeatures{VerticalPosition=Superior}} + \providecommand\infigures{\addfontfeatures{VerticalPosition=ScientificInferior}} + +\else % type1 + + \ifmintspirit@lining + \ifmintspirit@tabular + \def\mintspiritfamily{MintSpiritNoTwo-LF} + \else + \def\mintspiritfamily{MintSpiritNoTwo-TLF} + \fi + \else + \ifmintspirit@tabular + \def\mintspiritfamily{MintSpiritNoTwo-TOsF} + \else + \def\mintspiritfamily{MintSpiritNoTwo-OsF} + \fi + \fi + \renewcommand*\sfdefault{\mintspiritfamily} + \ifmintspirit@default\edef\familydefault{\sfdefault}\fi + + \providecommand*\mintspirit2{\fontfamily{\mintspiritfamily}\selectfont} + \providecommand*\tlstyle{\fontfamily{MintSpiritNoTwo-LF}\selectfont} + \providecommand*\tostyle{\fontfamily{MintSpiritNoTwo-TOsF}\selectfont} + \providecommand*\plstyle{\fontfamily{MintSpiritNoTwo-TLF}\selectfont} + \providecommand*\postyle{\fontfamily{MintSpiritNoTwo-OsF}\selectfont} + + + \fa@naming@exception{figures}{{inferior}{proportional}}{Inf} + \fa@naming@exception{figures}{{inferior}{tabular}}{Inf} + \fa@naming@exception{figures}{{superior}{proportional}}{Sup} + \fa@naming@exception{figures}{{superior}{tabular}}{Sup} + \providecommand\sufigures{\@nomath\sufigures\fontfigurestyle{superior}\selectfont} + \providecommand\infigures{\@nomath\infigures\fontfigurestyle{inferior}\selectfont} + +\fi + +\DeclareTextFontCommand{\textpl}{\plstyle} +\DeclareTextFontCommand{\textpo}{\postyle} +\DeclareTextFontCommand{\texttl}{\tlstyle} +\DeclareTextFontCommand{\textto}{\tostyle} + +\DeclareTextFontCommand{\textsu}{\sufigures} +\DeclareTextFontCommand{\textin}{\infigures} + +% turn off defaults in case other fonts are selected: +\ifmintspirit@otf + \defaultfontfeatures{} +\fi + +\endinput + |