summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lwarp/lwarp-fontawesome5-utex-helper.sty
blob: e84c6770f98f877c30ac834ed8b76a9c0311dc1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
%%
%% This is file `lwarp-fontawesome5-utex-helper.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% lwarp.dtx  (with options: `fontawesome5-utex-helper')
%% This is a generated file.
%% Copyright 2016-2025 Brian Dunn
%% 
%% 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.
%%
\LWR@ProvidesPackagePass{fontawesome5-utex-helper}[2022/05/02]
\ExplSyntaxOn

\VerifyCommand[lwarp][fontawesome5-utex-helper]{\fontawesome_use_icon:nn}
    {8452FF2BF0A317552B0920628ADD8C18}

\cs_set:Nn\fontawesome_use_icon:nn{
  \group_begin:
    \LWR@findcurrenttextcolor
    \usefont
      {TU}
      {fontawesome\c__fontawesome_kind_tl}
      {#1}
      {n}
    \bool_set:Nn \l__fontawesome_duotone_bool {
      \str_if_eq_p:ee {#1} {duotone}
    }
    \int_set:Nn\l_tmpa_int{
      \__fontawesome_glyphindex:n{
        #2
        \bool_if:NT \l__fontawesome_duotone_bool { -primary }
      }
    }
    \int_compare:nNnT{\l_tmpa_int}={0}{
      \fontseries{solid}
      \selectfont
      \bool_set_false:N \l__fontawesome_duotone_bool
      \int_set:Nn\l_tmpa_int{\__fontawesome_glyphindex:n{#2}}
      \int_compare:nNnTF{\l_tmpa_int}={0}{
        \fontfamily{fontawesomebrands}
        \fontseries{regular}
        \selectfont
        \int_set:Nn\l_tmpa_int{\__fontawesome_glyphindex:n{#2}}
        \int_compare:nNnT{\l_tmpa_int}={0}{
          \msg_error:nnxx{fontawesome5}{icon-not-found}{#2}{#1}
        }
      }{
        \msg_warning:nnxx{fontawesome5}{style-substitution}{#2}{#1}
      }
    }
    \begin{lateximage}*[#2]?%   lwarp
        [fontawesome5#1SZ\LWR@font@size{}CL\LWR@tempcolor]%     lwarp
    \csuse{\LWR@font@size}%     lwarp
    \bool_if:NTF\c__fontawesome_fixed_bool{
      \makebox[1.5em][c]
    }{
      \use:n
    }
    {
      \bool_if:NTF \l__fontawesome_duotone_bool {
        \__fontawesome_glyph:w \l_tmpa_int
        \int_set:Nn\l_tmpa_int{ \__fontawesome_glyphindex:n{ #2-secondary } }
        \int_compare:nNnF { \l_tmpa_int } = { 0 } {
          \llap {
            \l_fontawesome_duotone_secondary_style_tl
            { \__fontawesome_glyph:w \l_tmpa_int }
          }
        }
        % \ooalign {
        %   \hss \__fontawesome_glyph:w \l_tmpa_int \hss \cr
        %   \hss
        %   \int_set:Nn\l_tmpa_int{ \__fontawesome_glyphindex:n{ #2-secondary } }
        %   \int_compare:nNnF { \l_tmpa_int } = { 0 } {
        %     \color{gray}\__fontawesome_glyph:w \l_tmpa_int
        %   }
        %   \hss \cr
        % }
      } {
        \__fontawesome_glyph:w \l_tmpa_int
      }
    }
    \end{lateximage}% lwarp
  \group_end:
}
\ExplSyntaxOff

\endinput
%%
%% End of file `lwarp-fontawesome5-utex-helper.sty'.