diff options
author | Karl Berry <karl@freefriends.org> | 2013-05-02 21:52:06 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-05-02 21:52:06 +0000 |
commit | ca2ad87300f7fb47774a8b8b0dc98018c8f54da2 (patch) | |
tree | 6373b5337dfd50bbf4b12b6396b5dd6c21a2452d /Master/texmf-dist/tex/latex/raleway/raleway.sty | |
parent | af17255de8ba608f03d26eeb4ef5a774990da738 (diff) |
raleway (2may13)
git-svn-id: svn://tug.org/texlive/trunk@30211 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/raleway/raleway.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/raleway/raleway.sty | 250 |
1 files changed, 250 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/raleway/raleway.sty b/Master/texmf-dist/tex/latex/raleway/raleway.sty new file mode 100644 index 00000000000..f236d5fa294 --- /dev/null +++ b/Master/texmf-dist/tex/latex/raleway/raleway.sty @@ -0,0 +1,250 @@ +% Raleway for LaTeX +% +% Silke Hofstra, tex@slxh.nl +% +% This file selects either the OTF or the TYPE1 fonts based on +% the LaTeX engine used. +% +% Licenced under the LPPL v1.3 or higher. +% +\NeedsTeXFormat{LaTeX2e}[1994/12/01] +\ProvidesPackage{raleway}[2013/04/14 v1.0 Matt McInerney’s Raleway family] + +\RequirePackage{ifxetex,ifluatex,xkeyval} + +% Switches +\newif\ifraleway@otf +\newif\ifraleway@default +\newif\ifraleway@sfdefault +\newif\ifraleway@oldstyle +\newif\ifraleway@tabular +\newif\ifraleway@black +\newif\ifraleway@extrabold +\newif\ifraleway@semibold +\newif\ifraleway@medium +\newif\ifraleway@light +\newif\ifraleway@extralight +\newif\ifraleway@thin + +% Scaling command +\newcommand*{\raleway@scale}{1} + +% Use OpenType fonts for XeTeX and LuaTeX. +\ifxetex + \raleway@otftrue +\else + \ifluatex + \raleway@otftrue + \fi +\fi + +\DeclareOptionX{lining} {\raleway@oldstylefalse} +\DeclareOptionX{nf} {\raleway@oldstylefalse} +\DeclareOptionX{lf} {\raleway@oldstylefalse} +\DeclareOptionX{oldstyle} {\raleway@oldstyletrue} +\DeclareOptionX{osf} {\raleway@oldstyletrue} +\DeclareOptionX{black} {\raleway@blacktrue} +\DeclareOptionX{extrabold} {\raleway@extraboldtrue} +\DeclareOptionX{semibold} {\raleway@semiboldtrue} +\DeclareOptionX{bold} {} +\DeclareOptionX{thin} {\raleway@thintrue} +\DeclareOptionX{extralight} {\raleway@extralighttrue} +\DeclareOptionX{light} {\raleway@lighttrue} +\DeclareOptionX{regular} {} +\DeclareOptionX{medium} {\raleway@mediumtrue} +\DeclareOptionX{scale} {\renewcommand*{\raleway@scale}{#1}} +\DeclareOptionX{scaled} {\renewcommand*{\raleway@scale}{#1}} +\DeclareOptionX{default} {\raleway@defaulttrue} +\DeclareOptionX{sfdefault} {\raleway@sfdefaulttrue} +\DeclareOptionX{nosfdefault} {\raleway@sfdefaultfalse} +\DeclareOptionX{type1} {\raleway@otffalse} +\DeclareOptionX{t1} {\raleway@otffalse} +\DeclareOptionX{opentype} {\raleway@otftrue} +\DeclareOptionX{otf} {\raleway@otftrue} + +% Default options +\ExecuteOptionsX{sfdefault,lining,bold,regular} +\ProcessOptionsX\relax + +% Load OpenType files +\ifraleway@otf + \RequirePackage{fontspec} + + % Oldstyle/Lining + \ifraleway@oldstyle + \def\raleway@figurestyle{OldStyle} + \else + \def\raleway@figurestyle{Lining} + \fi + + % Black/Semibold/Bold + \ifraleway@extrabold + \def\raleway@boldstyle{ExtraBold} + \else + \ifraleway@semibold + \def\raleway@boldstyle{Semibold} + \else + \ifraleway@black + \def\raleway@boldstyle{Black} + \else + \def\raleway@boldstyle{Bold} + \fi + \fi + \fi + + % Light/ExtraLight/Regular/Medium + \ifraleway@light + \def\raleway@regstyle{Light} + \else + \ifraleway@extralight + \def\raleway@regstyle{ExtraLight} + \else + \ifraleway@thin + \def\raleway@regstyle{Thin} + \else + \ifraleway@medium + \def\raleway@regstyle{Medium} + \else + \def\raleway@regstyle{Regular} + \fi + \fi + \fi + \fi + + % Shared features + \defaultfontfeatures{ + Ligatures = TeX , + Numbers = \raleway@figurestyle , + Scale = \raleway@scale , + Extension = .otf } + + % Sans serif font + \ifraleway@sfdefault + \setsansfont + [ UprightFont = *-\raleway@regstyle , + BoldFont = *-\raleway@boldstyle ] + {raleway} + \fi + + % Font families + % Regular/Bold + \newfontfamily\raleway + [ UprightFont = *-Regular , + BoldFont = *-Bold ] + {Raleway} + + \newfontfamily\ralewaymedium + [ UprightFont = *-Medium , + BoldFont = *-Bold ] + {Raleway} + + % Light/Semibold + \newfontfamily\ralewaylight + [ UprightFont = *-Light , + BoldFont = *-Semibold ] + {Raleway} + + % Light/Semibold + \newfontfamily\ralewaythin + [ UprightFont = *-Thin , + BoldFont = *-Black ] + {Raleway} + + % ExtraLight/Black + \newfontfamily\ralewayextra + [ UprightFont = *-ExtraLight , + BoldFont = *-ExtraBold ] + {Raleway} + + % Dont keep all default font features + \defaultfontfeatures{} + + \newfontfamily\ralewayLF + [ Ligatures = TeX , + Numbers = Lining , + Scale = \raleway@scale , + Extension = .otf , + UprightFont = *-\raleway@regstyle , + BoldFont = *-\raleway@boldstyle ] + {raleway} + +% Load type1 font. +\else + \RequirePackage[OT1,LY1,T1]{fontenc} + + % Tabular/Proportional + \ifraleway@tabular + \def\raleway@figurealign{T} + \else + \def\raleway@figurealign{} + \fi + + % Oldstyle/Lining + \ifraleway@oldstyle + \def\raleway@figurestyle{OsF} + \else + \def\raleway@figurestyle{LF} + \def\raleway@figurealign{T} + \fi + + % Black/Semibold/Bold + \ifraleway@extrabold + \renewcommand*{\bfdefault}{eb} + \else + \ifraleway@semibold + \renewcommand*{\bfdefault}{sb} + \else + \ifraleway@black + \renewcommand*{\bfdefault}{k} + \else + \renewcommand*{\bfdefault}{b} + \fi + \fi + \fi + + % Light/ExtraLight/Regular/Medium/Thin + \ifraleway@light + \renewcommand*{\mddefault}{l} + \else + \ifraleway@extralight + \renewcommand*{\mddefault}{el} + \else + \ifraleway@thin + \renewcommand*{\mddefault}{t} + \else + \ifraleway@medium + \renewcommand*{\mddefault}{mb} + \else + \renewcommand*{\mddefault}{m} + \fi + \fi + \fi + \fi + + % Sans serif font + \ifraleway@sfdefault + \renewcommand* + {\sfdefault} + {Raleway-\raleway@figurealign\raleway@figurestyle} + \fi + + % If Raleway is the default font \oldstylenums needs a new definition. + \ifraleway@default + \renewcommand*\oldstylenums[1]{% + \begingroup + \ifmmode + \mathgroup\symletters #1% + \else + \fontfamily{Raleway-\raleway@figurealign OsF}\selectfont #1% + \fi + \endgroup + } + \fi +\fi + +% Set default font family +\ifraleway@default + \let\familydefault\sfdefault +\fi + +\endinput
\ No newline at end of file |