%%
%% This is file `iffont.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% iffont.dtx  (with options: `package')
%% Copyright (C) 2015 by Benjamin Weiss <weissbenjamin@me.com>
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%% 
%% This work has the LPPL maintenance status `maintained'.
%% 
%% The Current Maintainer of this work is Benjamin Weiss.
%% 
%% This work consists of the files iffont.dtx and iffont.ins and the
%% derived file iffont.sty.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{iffont}
    [2015/11/11 1.0.0 Iffont package]
\RequirePackage{fontspec}
\RequirePackage{etoolbox}
\newtoggle{@iffont@fontfound}
\newcommand{\@iffont@firstfont}{Fira Sans}
\newcounter{@iffont@fontsnotfound}
\newcommand{\iffontsexist}[3]{
  \setcounter{@iffont@fontsnotfound}{0}
  \expandafter\forcsvlist\expandafter\@iffont@checkfont\expandafter{#1}
  \ifnumequal{\value{@iffont@fontsnotfound}}{0}{%
    #2
  }{%
    #3
  }
}
\newcommand{\ifxfontsexist}[3]{
  \iffontsexist{#1}{#3}{#2}
}
\newcommand{\iffontexists}[3]{
  \suppressfontnotfounderror=1
  \font\x = "#1" at 10pt
  \ifx\x\nullfont
    #3
  \else
    #2
  \fi
  \suppressfontnotfounderror=0
}
\newcommand{\ifxfontexists}[3]{
  \iffontexists{#1}{#3}{#2}
}
\newcommand{\settofirstfound}[2]{
  \togglefalse{@iffont@fontfound}
  \expandafter\forcsvlist\expandafter\@iffont@checkfont\expandafter{#2}
  \let#1\@iffont@firstfont
}
\newcommand{\@iffont@checkfont}[1]{
  \suppressfontnotfounderror=1
  \font\x = "#1" at 10pt
  \ifx\x\nullfont
    \stepcounter{@iffont@fontsnotfound}
  \else
    \nottoggle{@iffont@fontfound}{%
      \renewcommand{\@iffont@firstfont}{#1}
      \toggletrue{@iffont@fontfound}
    }{}
  \fi
  \suppressfontnotfounderror=0
}
\endinput
%%
%% End of file `iffont.sty'.
