%% fbb.sty
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{fbb}
    [2013/08/12 (Michael Sharpe)  Style file for fbb.]

\RequirePackage[LY1,T1]{fontenc}
\RequirePackage{textcomp}
\IfFileExists{mweights.sty}{\RequirePackage{mweights}}{}
\IfFileExists{fontaxes.sty}{
    \RequirePackage{fontaxes}
    \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
    \def\@makefnmark{\hbox{\textsu{\@thefnmark}}}
}{}

\IfFileExists{xkeyval.sty}{
    \newcommand*{\fbb@scale}{1}
    \RequirePackage{xkeyval}
    \DeclareOptionX{scale}{\renewcommand*{\fbb@scale}{##1}}
    \DeclareOptionX{scaled}{\renewcommand*{\fbb@scale}{##1}}
}{
    \let\DeclareOptionX\DeclareOption
    \let\ExecuteOptionsX\ExecuteOptions
    \let\ProcessOptionsX\ProcessOptions
}

\DeclareOptionX{lining}{\edef\fbb@figurestyle{LF}}
\DeclareOptionX{oldstyle}{\edef\fbb@figurestyle{OsF}}
\DeclareOptionX{tabular}{\edef\fbb@figurealign{T}}
\DeclareOptionX{proportional}{\edef\fbb@figurealign{}}
\DeclareOptionX{bold}{\edef\bfseries@rm{b}}
\DeclareOptionX{regular}{\edef\mdseries@rm{m}}
\ExecuteOptionsX{lining,tabular,bold,regular}
\ProcessOptionsX\relax

\def\useosf{\edef\fbb@figurestyle{OsF}\edef\fbb@figurealign{}%
  \renewcommand*{\rmdefault}{fbb-OsF}}
\@onlypreamble\useosf
\def\usetosf{\edef\fbb@figurestyle{OsF}\edef\fbb@figurealign{T}%
  \renewcommand*{\rmdefault}{fbb-TOsF}}
\@onlypreamble\usetosf

\DeclareRobustCommand{\textlf}[1]{%
  {\fontfamily{fbb-LF}\selectfont #1}%
}% to get lf
\DeclareRobustCommand{\texttlf}[1]{%
  {\fontfamily{fbb-TLF}\selectfont #1}%
}% to get tlf
\DeclareRobustCommand{\textosf}[1]{%
  {\fontfamily{fbb-OsF}\selectfont #1}%
}% to get osf
\DeclareRobustCommand{\texttosf}[1]{%
  {\fontfamily{fbb-TOsF}\selectfont #1}%
}% to get tosf

\renewcommand*{\rmdefault}{fbb-\fbb@figurealign\fbb@figurestyle}
\renewcommand*{\familydefault}{\rmdefault}

\endinput
