diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/plex/plex-sans.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/plex/plex-sans.sty | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/plex/plex-sans.sty b/Master/texmf-dist/tex/latex/plex/plex-sans.sty new file mode 100644 index 00000000000..a05630477a3 --- /dev/null +++ b/Master/texmf-dist/tex/latex/plex/plex-sans.sty @@ -0,0 +1,94 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{plex-sans} + [2017/11/13 (Bob Tennent) Style file for IBMPlexSans fonts] + +\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp} + +\newif\ifplexsans@otf +\ifxetex + \plexsans@otftrue +\else\ifluatex + \plexsans@otftrue +\else % [pdf]LaTeX + \plexsans@otffalse +\fi\fi + +\ifplexsans@otf + \RequirePackage{fontspec} + \def\plexsans@medstyle{Regular} + \def\plexsans@boldstyle{Bold} +\else % type1 + \RequirePackage{fontenc,fontaxes,mweights} + \def\bfseries@sf{b} + \def\mdseries@sf{m} + \def\plexsans@figurestyle{LF} + \def\plexsans@figurealign{T} + \fa@naming@exception{figures}{{superior}{proportional}}{Sup} + \fa@naming@exception{figures}{{superior}{tabular}}{Sup} + \def\sufigures{\@nomath\sufigures + \fontfigurestyle{superior}\selectfont} + \DeclareTextFontCommand{\textsu}{\sufigures} + \let\textsuperior\textsu +\fi + +\newcommand*{\IBMPlexSans@scale}{1} +\DeclareOptionX{scale}{\renewcommand*{\IBMPlexSans@scale}{#1}} + + +\newif\ifplexsans@sfdefault \plexsans@sfdefaultfalse + +\DeclareOptionX{type1}{\plexsans@otffalse} +\DeclareOptionX{sfdefault}{\plexsans@sfdefaulttrue} + +\DeclareOptionX{thin}{\edef\mdseries@rm{t}\def\plexsans@medstyle{Thin}} +\DeclareOptionX{t}{\edef\mdseries@rm{t}\def\plexsans@medstyle{Thin}} +\DeclareOptionX{extralight}{\edef\mdseries@rm{el}\def\plexsans@medstyle{ExtraLight}} +\DeclareOptionX{el}{\edef\mdseries@rm{el}\def\plexsans@medstyle{ExtraLight}} +\DeclareOptionX{light}{\edef\mdseries@rm{l}\def\plexsans@medstyle{Light}} +\DeclareOptionX{l}{\edef\mdseries@rm{l}\def\plexsans@medstyle{Light}} +\DeclareOptionX{text}{\edef\bfseries@rm{tx}\def\plexsans@boldstyle{Text}} +\DeclareOptionX{tx}{\edef\bfseries@rm{tx}\def\plexsans@boldstyle{Text}} +\DeclareOptionX{medium}{\edef\bfseries@rm{mb}\def\plexsans@boldstyle{Medium}} +\DeclareOptionX{m}{\edef\bfseries@rm{mb}\def\plexsans@boldstyle{Medium}} +\DeclareOptionX{semibold}{\edef\bfseries@rm{sb}\def\plexsans@boldstyle{SemiBold}} +\DeclareOptionX{sb}{\edef\bfseries@rm{sb}\def\plexsans@boldstyle{SemiBold}} + + +\ProcessOptionsX\relax + + +\ifplexsans@otf + \ifxetex\XeTeXtracingfonts=1\fi + \defaultfontfeatures{ + Ligatures = TeX , + Scale = \IBMPlexSans@scale , + Extension = .otf } + \setsansfont + [ UprightFont = *-\plexsans@medstyle , + ItalicFont = *-\plexsans@medstyle Italic , + BoldFont = *-\plexsans@boldstyle , + BoldItalicFont = *-\plexsans@boldstyle Italic ] + {IBMPlexSans} + \let\plexsansfamily\sfdefault + \newfontfamily\plexsans + [ UprightFont = *-\plexsans@medstyle , + ItalicFont = *-\plexsans@medstyle Italic , + BoldFont = *-\plexsans@boldstyle , + BoldItalicFont = *-\plexsans@boldstyle Italic ] + {IBMPlexSans} + \ifplexsans@sfdefault\renewcommand*\familydefault{\plexsansfamily}\fi + + +\else % type1 + \def\plexsansfamily{IBMPlexSans-\plexsans@figurealign\plexsans@figurestyle} + \newcommand*\plexsans{\fontfamily{\plexsansfamily}\selectfont} + \def\sfdefault{\plexsansfamily} + \ifplexsans@sfdefault\edef\familydefault{\sfdefault}\fi +\fi + +\ifplexsans@otf + % turn off defaults in case other fonts are selected: + \defaultfontfeatures{} +\fi + +\endinput |