\ProvidesPackage{LobsterTwo}[%
   2022/09/19 (Bob Tennent)  Supports Lobster Two fonts for all LaTeX engines. ] 

\RequirePackage{ifxetex,ifluatex,textcomp}

\newif\ifLobsterTwo@otf
\ifxetex
  \LobsterTwo@otftrue
\else\ifluatex
  \LobsterTwo@otftrue
\else  % [pdf]LaTeX
  \LobsterTwo@otffalse
\fi\fi

\newcommand*{\Lbstr@scale}{1}  
\RequirePackage{xkeyval}
\DeclareOptionX{scaled}{\renewcommand*{\Lbstr@scale}{#1}}
\DeclareOptionX{scale}{\renewcommand*{\Lbstr@scale}{#1}}

\DeclareOptionX{type1}{\LobsterTwo@otffalse}

\ProcessOptionsX\relax

\ifLobsterTwo@otf
  \RequirePackage{fontspec}
\else
  \RequirePackage{fontenc,fontaxes}
\fi

\ifLobsterTwo@otf
  \defaultfontfeatures{
     Ligatures = TeX ,
     Extension = .otf ,
     Scale = \Lbstr@scale ,
  }
  \setmainfont
      [ UprightFont    = *-Regular ,
        ItalicFont     = *-Italic ,
        BoldFont       = *-Bold , 
        BoldItalicFont = *-BoldItalic ]
      {LobsterTwo}
  \newfontfamily\LobsterTwo
      [ UprightFont    = *-Regular ,
        ItalicFont     = *-Italic ,
        BoldFont       = *-Bold , 
        BoldItalicFont = *-BoldItalic ]
      {LobsterTwo}

\else % type1

  \def\LobsterTwofamily{Lbstr-LF}
  \renewcommand*\rmdefault{\LobsterTwofamily}
  \newcommand*\LobsterTwo{\fontfamily{\LobsterTwofamily}\selectfont}

\fi

% turn off defaults in case other fonts are selected:
\ifLobsterTwo@otf
  \defaultfontfeatures{}
\fi

\endinput

