% \iffalse meta-comment
% 
% File: linguistix-greek.dtx
% 
% ----------------------------------------------------------
% The LaTeX bundle LinguisTiX v0.9a
% Copyright © 2025, 2026 निरंजन
% 
% This program is free software: you can redistribute it
% and/or modify it under the terms of the GNU General Public
% License as published by the Free Software Foundation,
% either version 3 of the License, or (at your option) any
% later version.
% 
% This program is distributed in the hope that it will be
% useful, but WITHOUT ANY WARRANTY; without even the implied
% warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
% PURPOSE. See the GNU General Public License for more
% details.
% 
% You should have received a copy of the GNU General Public
% License along with this program. If not, see
% <https://www.gnu.org/licenses/>.
% ----------------------------------------------------------
% 
% \fi
% \iffalse
%<*driver>
\documentclass{l3doc}
\usepackage{linguistix}
\usepackage{xcolor}
\usepackage{fontawesome5}
\usepackage[verbose=silent]{microtype}
\usepackage{cleveref}
\usepackage{hyperxmp}

\makeatletter
\def\@xobeysp{\hphantom{X}}%
\makeatother

\linguistix{old style one}
\loadlanguages{british,greek,marathi}

\setquotestyle{british}

\colorlet{lngxredcolor}{red!50!black}
\colorlet{lngxgreencolor}{green!50!black}
\colorlet{lngxbluecolor}{blue!50!black}

\urlstyle{tt}

\hypersetup{%
  unicode,%
  colorlinks,%
  linkcolor              = {lngxredcolor},
  citecolor              = {lngxgreencolor},
  urlcolor               = {lngxbluecolor},
  pdftitle               = {linguistix-greek},%
  pdfauthor              = {निरंजन},%
  pdfsubject             = {%
    Ελληνικά (Greek) with LinguisTiX.%
  },%
  pdfcreator             = {निरंजन},%
  pdfkeywords            = {Linguistics, LaTeX},%
  pdfcopyright           = {%
    The LaTeX bundle LinguisTiX\textLF
    Copyright © 2025, 2026 निरंजन\textLF
    This program is free software: you can redistribute it
    and/or modify it under the terms of the GNU General
    Public License as published by the Free Software
    Foundation, either version 3 of the License, or (at your
    option) any later version.%
  },%
  pdflicenseurl          = {gnu.org/licenses/gpl-3.0.html}%
}%

\colorlet{lngxpurplecolor}{blue!50!red}

\ExplSyntaxOn
\msg_redirect_name:nnn { l3doc }
                       { foreign-internal }
                       { none }
\ExplSyntaxOff

\makeatletter
\NewDocumentCommand \supportfootnote { +m } {%
  \begingroup
  \def\thefootnote{}%
  \let\@makefntext\relax
  \def\Hy@Warning##1{}%
  \footnotetext{%
    \hspace*{-\parindent}%
    #1%
  }%
  \endgroup
}
\makeatother

\begin{document}
\DocInput{\jobname.dtx}
\end{document}
%</driver>
% \fi
% \title{Ελληνικά\,--\,\lngxgreeklogo}
% \author{निरंजन}
% \date{^^A
%   \today\ (v0.9a)\\[1ex]^^A
%   {^^A
%     \small\faIcon{home}\quad
%     \url{^^A
%       https://ctan.org/pkg/linguistix^^A
%     }\\[0.5ex]^^A
%     \small\faIcon{git-alt}\quad
%     \url{^^A
%       https://puszcza.gnu.org.ua/projects/linguistix^^A
%     }\\[0.5ex]^^A
%     \small\faIcon[regular]{comments}\quad
%     \url{^^A
%       https://matrix.to/\#/\#linguistix:matrix.org^^A
%     }^^A
%   }^^A
% }
% 
% \maketitle
%
% \supportfootnote{^^A
%   The \lngxpkg\ bundle
%
%   \noindent
%   Copyright © 2025, 2026 निरंजन
%
%   This program is free software: you can redistribute it
%   and/or modify it under the terms of the \textsc{gnu}
%   General Public License as published by the Free Software
%   Foundation, either version 3 of the License, or (at your
%   option) any later version.
%
%   This program is distributed in the hope that it will be
%   useful, but \emph{\textbf{without any warranty}};
%   without even the implied warranty of
%   \emph{\textbf{merchantability}} or \emph{\textbf{fitness
%   for a particular purpose}}. See the \textsc{gnu} General
%   Public License for more details.
%
%   You should have received a copy of the \textsc{gnu}
%   General Public License along with this program. If not,
%   see \url{https://www.gnu.org/licenses/}.^^A
% }
%
%   \begin{implementation}
% \noindent I initialise the package with basic information.
%    \begin{macrocode}
%<*greek>
\ProvidesExplPackage{linguistix-greek}
                    {2026-04-24}
                    {v0.9a}
                    {Ελληνικά (Greek)}
%    \end{macrocode}
% First, I add the |onchar| parameter that loads the Greek
% fonts with the respective Unicode automatically. This is
% used with the \cs{babelprovide} command.
%    \begin{macrocode}

\babelprovide [ onchar   = { ids~ fonts } ] { greek }
%    \end{macrocode}
% The \pkg{babel} package defines |\extrasxxxx| commands for
% languages where the additional code that should go with a
% particular language (|xxxx| in this case) is set. The
% |\addto| command is used for appending to the same. I
% start with defining additional macros for Greek.
%    \begin{macrocode}

\addto { \extrasgreek } {
%    \end{macrocode}
% I have added the command for using the socket for native
% numbering. It will pickup its value from the current
% assignment of the plugs and produce the results
% accordingly.
%    \begin{macrocode}
  \socket_use:n { lngx / native-numbering }
%    \end{macrocode}
% The default \LaTeX\ produces Latin numerals, roman (small
% and capital both) alphabets and a-z alphabets with
% enumerate at different levels of nesting. In Greek,
% although Latin numerals are fine, the letters are
% irrelevant. Thus I renew all of the concerned commands
% and change them to print Greek counters.
%    \begin{macrocode}
  \cs_set:Npn \theenumii {
    \localecounter { lower.modern } { enumii }
  }
  \cs_set:Npn \theenumiv {
    \localecounter { upper.modern } { enumiv }
  }
%    \end{macrocode}
% The \pkg{expex} package has an independent mechanism of
% defining and using counters. In order to get Greek labels,
% I use the |greek| style provided by the \pkg{expex}
% package by default. Note that this change will go with the
% \cs{lngx_misc_reset:} command. Refer to |linguistix.pdf|
% for more information on this.
%    \begin{macrocode}
  \IfPackageLoadedT { expex } {
    \lingset {
      labeltype                = { greek }
    }
  }
}
%    \end{macrocode}
% If Greek is the main language of the document, the default
% New Computer Modern fonts suffice, but if it is not the
% main language, we need to use the macros that set the
% ‘other’ (non-main) fonts. The fonts are the same, but the
% key-value interface is not available, so the code is
% slightly verbose.
%    \begin{macrocode}
\lngx_other_main_font:nnn { greek } {
  NFSSFamily               = { Ελληνικά_main },
  IgnoreFontspecFile,
  \bool_if:NT \g_lngx_old_style_bool {
    Numbers              = { OldStyle },
  }
  \bool_if:NT \g_lngx_old_style_one_bool {
    CharacterVariant     = { 6 },
  }
  Renderer             = { HarfBuzz },
  UprightFont          = { NewCM10-Book.otf },
  UprightFeatures      = {
    SizeFeatures         = {
      {
        Size                 = { -8 },
        Font                 = { NewCM08-Book.otf }
      },
      {
        Size                 = { 8- },
        Font                 = { NewCM10-Book.otf }
      }
    }
  },
  ItalicFont           = { NewCM10-BookItalic.otf },
  ItalicFeatures       = {
    SizeFeatures         = {
      {
        Size                 = { -8 },
        Font                 = { NewCM08-BookItalic.otf }
      },
      {
        Size                 = { 8- },
        Font                 = { NewCM10-BookItalic.otf }
      }
    }
  },
  BoldFont             = { NewCM10-Bold.otf },
  BoldFeatures         = {
    SizeFeatures         = {
      {
        Size                 = { 0- },
        Font                 = { NewCM10-Bold.otf }
      }
    }
  },
  BoldItalicFont       = { NewCM10-BoldItalic.otf },
  BoldItalicFeatures   = {
    SizeFeatures         = {
      {
        Size                 = { 0- },
        Font                 = { NewCM10-BoldItalic.otf }
      }
    }
  },
  SlantedFont          = { NewCM10-Book.otf },
  SlantedFeatures      = {
    SizeFeatures         = {
      {
        Size                 = { -8 },
        Font                 = { NewCM08-Book.otf }
      },
      {
        Size                 = { 8- },
        Font                 = { NewCM10-Book.otf }
      }
    }
  },
  BoldSlantedFont      = { NewCM10-Bold.otf },
  BoldSlantedFeatures  = {
    SizeFeatures         = {
      {
        Size                 = { 0- },
        Font                 = { NewCM10-Bold.otf }
      }
    }
  },
  SwashFont            = { NewCM10-Book.otf },
  SwashFeatures        = {
    SizeFeatures         = {
      {
        Size                 = { -8 },
        Font                 = { NewCM08-Book.otf }
      },
      {
        Size                 = { 8- },
        Font                 = { NewCM10-Book.otf }
      }
    }
  },
  BoldSwashFont        = { NewCM10-Bold.otf },
  BoldSwashFeatures    = {
    SizeFeatures         = {
      {
        Size                 = { 0- },
        Font                 = { NewCM10-Bold.otf }
      }
    }
  }
} { NewCM10-Book.otf }
\lngx_other_sans_font:nnn { greek } {
  NFSSFamily               = { Ελληνικά_sans },
  IgnoreFontspecFile,
  \bool_if:NT \g_lngx_old_style_bool {
    Numbers              = { OldStyle },
  }
  \bool_if:NT \g_lngx_old_style_one_bool {
    CharacterVariant     = { 6 },
  }
  Renderer             = { HarfBuzz },
  UprightFont          = { NewCMSans10-Book.otf },
  UprightFeatures      = {
    SizeFeatures         = {
      {
        Size                 = { -8 },
        Font                 = { NewCMSans08-Book.otf }
      },
      {
        Size                 = { 8- },
        Font                 = { NewCMSans10-Book.otf }
      }
    }
  },
  ItalicFont           = { NewCMSans10-BookOblique.otf },
  ItalicFeatures       = {
    SizeFeatures         = {
      {
        Size                 = { -8 },
        Font                 = {
          NewCMSans08-BookOblique.otf
        }
      },
      {
        Size                 = { 8- },
        Font                 = {
          NewCMSans10-BookOblique.otf
        }
      }
    }
  },
  BoldFont             = { NewCMSans10-Bold.otf },
  BoldFeatures         = {
    SizeFeatures         = {
      {
        Size                 = { 0- },
        Font                 = { NewCMSans10-Bold.otf }
      }
    }
  },
  BoldObliqueFont       = { NewCMSans10-BoldOblique.otf },
  BoldObliqueFeatures   = {
    SizeFeatures         = {
      {
        Size                 = { 0- },
        Font                 = {
          NewCMSans10-BoldOblique.otf
        }
      }
    }
  },
  SlantedFont          = { NewCMSans10-Book.otf },
  SlantedFeatures      = {
    SizeFeatures         = {
      {
        Size                 = { -8 },
        Font                 = { NewCMSans08-Book.otf }
      },
      {
        Size                 = { 8- },
        Font                 = { NewCMSans10-Book.otf }
      }
    }
  },
  BoldSlantedFont      = { NewCMSans10-Bold.otf },
  BoldSlantedFeatures  = {
    SizeFeatures         = {
      {
        Size                 = { 0- },
        Font                 = { NewCMSans10-Bold.otf }
      }
    }
  },
  SwashFont            = { NewCMSans10-Book.otf },
  SwashFeatures        = {
    SizeFeatures         = {
      {
        Size                 = { -8 },
        Font                 = { NewCMSans08-Book.otf }
      },
      {
        Size                 = { 8- },
        Font                 = { NewCMSans10-Book.otf }
      }
    }
  },
  BoldSwashFont        = { NewCMSans10-Bold.otf },
  BoldSwashFeatures    = {
    SizeFeatures         = {
      {
        Size                 = { 0- },
        Font                 = { NewCMSans10-Bold.otf }
      }
    }
  }
} { NewCMSans10-Book.otf }
\lngx_other_mono_font:nnn { greek } {
  NFSSFamily               = { Ελληνικά_mono },
  IgnoreFontspecFile,
  Renderer             = { HarfBuzz },
  UprightFont          = { NewCMMono10-Book.otf },
  UprightFeatures      = {
    SizeFeatures         = {
      {
        Size                 = { 0- },
        Font                 = { NewCMMono10-Book.otf }
      }
    }
  },
  ItalicFont           = { NewCMMono10-BookItalic.otf },
  ItalicFeatures       = {
    SizeFeatures         = {
      {
        Size                 = { 0- },
        Font                 = {
          NewCMMono10-BookItalic.otf
        }
      }
    }
  },
  BoldFont             = { NewCMMono10-Bold.otf },
  BoldFeatures         = {
    SizeFeatures         = {
      {
        Size                 = { 0- },
        Font                 = { NewCMMono10-Bold.otf }
      }
    }
  },
  BoldItalicFont       = { NewCMMono10-BoldOblique.otf },
  BoldItalicFeatures   = {
    SizeFeatures         = {
      {
        Size                 = { 0- },
        Font                 = {
          NewCMMono10-BoldOblique.otf
        }
      }
    }
  },
  SlantedFont          = { NewCMMono10-Book.otf },
  SlantedFeatures      = {
    SizeFeatures         = {
      {
        Size                 = { 0- },
        Font                 = { NewCMMono10-Book.otf }
      }
    }
  },
  BoldSlantedFont      = { NewCMMono10-Bold.otf },
  BoldSlantedFeatures  = {
    SizeFeatures         = {
      {
        Size                 = { 0- },
        Font                 = { NewCMMono10-Bold.otf }
      }
    }
  },
  SwashFont            = { NewCMMono10-Book.otf },
  SwashFeatures        = {
    SizeFeatures         = {
      {
        Size                 = { 0- },
        Font                 = { NewCMMono10-Book.otf }
      }
    }
  },
  BoldSwashFont        = { NewCMMono10-Bold.otf },
  BoldSwashFeatures    = {
    SizeFeatures         = {
      {
        Size                 = { 0- },
        Font                 = { NewCMMono10-Bold.otf }
      }
    }
  }
} { NewCMMono10-Book.otf }
%</greek>
%    \end{macrocode}
% \end{implementation}
% \selectlanguage{british}
% \Finale
