summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/iffont/iffont.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/iffont/iffont.sty')
-rw-r--r--Master/texmf-dist/tex/latex/iffont/iffont.sty77
1 files changed, 77 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/iffont/iffont.sty b/Master/texmf-dist/tex/latex/iffont/iffont.sty
new file mode 100644
index 00000000000..97f20e8ffe6
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/iffont/iffont.sty
@@ -0,0 +1,77 @@
+%%
+%% 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'.