%%
%% This is file `arsenal.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% arsenal.dtx  (with options: `package')
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from arsenal.sty.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file arsenal.dtx.
%% 
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
\ProvidesExplPackage {arsenal}
{2023-09-05} {v0.2}
{Arsenal font by Andrij Shevchenko}
\tl_new:N \l__arsenal_math_tl
\keys_define:nn {arsenal}
{
  default .bool_set:N = \l__arsenal_default_bool,
  default .default:n = true,
  sfdefault .bool_set:N = \l__arsenal_sfdefault_bool,
  sfdefault .default:n = true,
  math .choices:nn = {none, arsenal+kpsans, kpsans, iwona}
  {\tl_set_eq:NN \l__arsenal_math_tl \l_keys_choice_tl },
  scale .tl_set:N = \l__arsenal_scale_tl,
  Scale .tl_set:N = \l__arsenal_scale_tl,
}
\keys_set:nn { arsenal }
{
  default=true,
  sfdefault = false,
  scale = 0.89,
}
\tl_clear:N \l__arsenal_math_tl
\IfFormatAtLeastTF { 2022-06-01 }
  { \ProcessKeyOptions [ arsenal ] }
  {
    \RequirePackage { l3keys2e }
    \ProcessKeysOptions { arsenal }
  }
\tl_if_empty:NT \l__arsenal_math_tl
{
  \bool_if:NTF \l__arsenal_default_bool
  {
    \sys_if_engine_xetex:TF
    {
      \tl_set:Nn \l__arsenal_math_tl {iwona}
    }
    {
      \tl_set:Nn \l__arsenal_math_tl {arsenal+kpsans}
    }
  }
  {
    \tl_set:Nn \l__arsenal_math_tl {none}
  }
}
\RequirePackage{fontspec}
\newfontfamily\arsenalfamily{Arsenal-Regular.otf}
[
  NFSSFamily=arsenal,
  Ligatures=TeX,
  Scale=\l__arsenal_scale_tl,
  ItalicFont = Arsenal-Italic.otf,
  BoldFont = Arsenal-Bold.otf,
  BoldItalicFont = Arsenal-BoldItalic.otf,
  SwashFont = Arsenal-Regular.otf,
  SwashFeatures={Style=Swash},
  BoldSwashFont = Arsenal-Bold.otf,
  BoldSwashFeatures={Style=Swash},
  FontFace = {m}{itsw}{Font = Arsenal-Italic.otf, Style=Swash},
  FontFace = {b}{itsw}{Font = Arsenal-BoldItalic.otf, Style=Swash},
]
\bool_if:NT \l__arsenal_default_bool
{
  \renewcommand\rmdefault{arsenal}
}

\bool_if:NT \l__arsenal_sfdefault_bool
{
  \renewcommand\sfdefault{arsenal}
}
\DeclareTextFontCommand{\textarsenal}{\arsenalfamily}
\DeclareFontShapeChangeRule {sw}{it}  {itsw}  {it}
\DeclareFontShapeChangeRule {it}{sw}  {itsw}  {sw}
\DeclareUnicodeSymbol{\texthryvnia}       {"20B4}
\DeclareUnicodeSymbol{\texttugrik}        {"20AE}
\DeclareUnicodeSymbol{\texttenge}         {"20B8}
\DeclareUnicodeSymbol{\textruble}         {"20BD}
\DeclareUnicodeSymbol{\textaldine}        {"2767}
\DeclareUnicodeSymbol{\textsmilewhite}    {"263A}
\DeclareUnicodeSymbol{\textsmileblack}    {"263B}
\tl_new:N \l__arsenal_tmp_tl
\tl_if_eq:NnT \l__arsenal_math_tl {iwona}
{
  \tl_set:Nn \l__arsenal_tmp_tl {\fp_to_tl:n {\l__arsenal_scale_tl * 1.1}}
  \RequirePackage[Scale=\l__arsenal_tmp_tl, condensed, light]{iwonamath}
}
\tl_if_eq:NnT \l__arsenal_math_tl {kpsans}
{
  \tl_set:Ne \l__arsenal_tmp_tl {\fp_to_tl:n {\l__arsenal_scale_tl * 1.1}}
  \RequirePackage[symbols]{kpfonts-otf}
  \setmathfont{KpMath-Sans.otf}[
  Scale=\l__arsenal_tmp_tl,
  BoldFont=KpMath-SansBold.otf]

  \setmathfont{KpMath-Sans.otf}[
  range={cal,bfcal},
  RawFeature=+ss01,
  Scale=\l__arsenal_tmp_tl,
  BoldFont=KpMath-SansBold.otf]

  \setmathfont{KpMath-Sans.otf}[
  range={
    scr/{Latin},
    bfscr/{Latin},
    frak/{Latin},
    bffrak/{Latin},
    up/{Latin, Greek, misc},
    bb/{Latin, Greek, misc},
    it/{Latin, Greek, misc},
    bbit/{Latin, Greek, misc},
    tt/{Latin, Greek, misc},
    sfup/{Latin, Greek, misc},
    sfit/{Latin, Greek, misc},
    bfup/{Latin, Greek, misc},
    bfit/{Latin, Greek, misc},
    bfsfup/{Latin, Greek, misc},
    bfsfit/{Latin, Greek, misc},
  },
  Scale=\fp_to_tl:n {\l__arsenal_tmp_tl * 0.9},
  BoldFont=KpMath-SansBold.otf]
}
\tl_if_eq:NnT \l__arsenal_math_tl {arsenal+kpsans}
{
  \sys_if_engine_xetex:T
  {
    \ClassWarningNoLine{arsenal}{Option~ arsenal+kpsans~ may~ not~ work~
      with~ XeTeX~ engine.~  Please~ use~ lualatex}
  }
  \tl_set:Ne \l__arsenal_tmp_tl {\fp_to_tl:n {\l__arsenal_scale_tl * 1.1}}
  \RequirePackage[symbols]{kpfonts-otf}

  \setmathfont{KpMath-Sans.otf}[
  Scale=\l__arsenal_tmp_tl,
  BoldFont=KpMath-SansBold.otf]

  \setmathfont{KpMath-Sans.otf}[
  range={cal/{Latin},bfcal/{Latin}},
  RawFeature=+ss01,
  Scale=\fp_to_tl:n {\l__arsenal_tmp_tl * 0.9},
  BoldFont=KpMath-SansBold.otf]

  \setmathfont{KpMath-Sans.otf}[
  range={
    scr/{Latin, num},
    bfscr/{Latin, num},
    frak/{Latin, num},
    bffrak/{Latin, num},
    up/{Greek, misc, num},
    bb/{Latin, Greek, misc, num},
    it/{Greek, misc, num},
    bbit/{Greek, misc, num},
    tt/{Greek, misc, num},
    sfup/{Greek, misc, num},
    sfit/{Greek, misc, num},
    bfup/{Greek, misc, num},
    bfit/{Greek, misc, num},
    bfsfup/{Greek, misc, num},
    bfsfit/{Greek, misc, num},
  },
  Scale=\fp_to_tl:n {\l__arsenal_tmp_tl * 0.9},
  BoldFont=KpMath-SansBold.otf]

  \setmathfont{Arsenal-Regular.otf}[
  range={
    up/{Latin, latin, num},
    tt/{Latin, latin, num},
    sfup/{Latin, latin, num},
    bfup/{Latin, latin, num},
    bfsfup/{Latin, latin, num},
  },
  Scale=\l__arsenal_scale_tl,
  BoldFont=Arsenal-Bold.otf]

  \setmathfont{Arsenal-Italic.otf}[
  range={
    it/{Latin, latin, num},
    bbit/{Latin, latin, num},
    sfit/{Latin, latin, num},
    bfit/{Latin, latin, num},
    bfsfit/{Latin, latin, num},
  },
  Scale=\l__arsenal_scale_tl,
  BoldFont=Arsenal-BoldItalic.otf]

}
\endinput
%%
%% End of file `arsenal.sty'.
