From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Mon, 2 Sep 2019 13:46:59 +0900
Subject: Initial commit

---
 .../tex/fontawesome5-generic-helper.sty            | 62 ++++++++++++++++++++++
 1 file changed, 62 insertions(+)
 create mode 100644 fonts/fontawesome5/tex/fontawesome5-generic-helper.sty

(limited to 'fonts/fontawesome5/tex/fontawesome5-generic-helper.sty')

diff --git a/fonts/fontawesome5/tex/fontawesome5-generic-helper.sty b/fonts/fontawesome5/tex/fontawesome5-generic-helper.sty
new file mode 100644
index 0000000000..d368b444d4
--- /dev/null
+++ b/fonts/fontawesome5/tex/fontawesome5-generic-helper.sty
@@ -0,0 +1,62 @@
+% Copyright 2018--2019 Marcel Krueger
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% 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 Marcel Krueger
+%
+
+\@ifpackageloaded{fontawesome5}{}{\PackageError{fontawesome5-generic-helper}{This package should not be loaded individually. Load fontawesome5 instead.}{}}
+
+\ProvidesExplPackage{fontawesome5-generic-helper}{2019/06/07}{5.9.0}{non-uTeX helper for fontawesome5}
+
+\cs_new_protected:Nn\__fontawesome_def_icon:nnnnn{
+  \tl_if_empty:nF{#1}{
+    \cs_new_protected:Npn#1{\faPreselectedIcon{#2}}
+  }
+  \tl_const:cn{c__fontawesome_slot_#2_tl}{{#3}{#4}}
+}
+\file_input:n{fontawesome5-mapping.def}
+\cs_new_protected:Nn\__fontawesome_icon_at:nnnn{
+  {
+    \usefont
+      {U}
+      {fontawesome#1}
+      {#3}
+      {n}
+    \unless\iffontchar\font#2
+      \fontseries{solid}
+      \selectfont
+      \iffontchar\font#2
+        \msg_warning:nnxx{fontawesome5}{style-substitution}{#4}{#3}
+      \else
+        \msg_error:nnxx{fontawesome5}{icon-not-found}{#4}{#3}
+      \fi
+    \fi
+    \char#2
+  }
+}
+\cs_new_protected:Nn\fontawesome_use_icon:nn{
+  \cs_if_exist:cTF{c__fontawesome_slot_#2_tl}{
+    \bool_if:NTF\c__fontawesome_fixed_bool{
+      \makebox[1.5em][c]
+    }{
+      \use:n
+    }
+    {
+      \exp_last_unbraced:Nv
+        \__fontawesome_icon_at:nnnn
+        {c__fontawesome_slot_#2_tl}
+          {#1}{#2}
+    }
+  }{
+    \msg_error:nnxx{fontawesome5}{icon-not-found}{#2}{#1}
+  }
+}
-- 
cgit v1.2.3

