\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{futharksymb} [2026-03-25 v1.2.0 Adds macros for the younger- and elder futhark runes provided by allrunes]

% Undefine \swdefault so no conflict occurs
\let\swdefault\@undefined
\let\olddot\dot

\RequirePackage{allrunes}

\let\dot\olddot
\let\olddot\@undefined

% Handle options
\newboolean{younger}
\newboolean{elder}

\DeclareOption{younger}{
    \setboolean{younger}{true}
}
\DeclareOption{elder}{
    \setboolean{elder}{true}
}
\ProcessOptions\relax

% Enable younger futhark if both are false
\ifthenelse{\not\boolean{younger}\and\not\boolean{elder}}{\youngertrue}{}


% Younger Futhark
\ifyounger
    \newcommand{\youngerfuthark}{\textarn{fuþArk.hnias.tbmlR}}
    \newcommand{\fe}{\textarn{f}}
    \newcommand{\ur}{\textarn{u}}
    \newcommand{\thurs}{\textarn{þ}}
    \newcommand{\oss}{\textarn{A}}
    \newcommand{\reid}{\textarn{r}}
    \newcommand{\kaun}{\textarn{k}}

    \newcommand{\hagall}{\textarn{h}}
    \newcommand{\naud}{\textarn{n}}
    \newcommand{\iss}{\textarn{i}}
    \newcommand{\ar}{\textarn{a}}
    \newcommand{\sol}{\textarn{s}}

    \newcommand{\tyr}{\textarn{t}}
    \newcommand{\bjarkan}{\textarn{b}}
    \newcommand{\madr}{\textarn{m}}
    \newcommand{\logr}{\textarn{l}}
    \newcommand{\yr}{\textarn{R}}
\fi

% Elder Futhark
\ifelder
    \newcommand{\elderfuthark}{\textarc{fuþarkgw.hnijIPRs.tbemlŋdo}}
    \newcommand{\fehu}{\textarc{f}}
    \newcommand{\uruz}{\textarc{u}}
    \newcommand{\thurisaz}{\textarc{þ}}
    \newcommand{\ansuz}{\textarc{a}}
    \newcommand{\raido}{\textarc{r}}
    \newcommand{\kaunan}{\textarc{k}}
    \newcommand{\gebo}{\textarc{g}}
    \newcommand{\wunjo}{\textarc{w}}

    \newcommand{\hagalaz}{\textarc{h}}
    \newcommand{\naudiz}{\textarc{n}}
    \newcommand{\isaz}{\textarc{i}}
    \newcommand{\jera}{\textarc{{j}}}
    \newcommand{\ihwaz}{\textarc{I}}
    \newcommand{\perth}{\textarc{p}}
    \newcommand{\algiz}{\textarc{R}}
    \newcommand{\sowilo}{\textarc{s}}

    \newcommand{\tiwaz}{\textarc{t}}
    \newcommand{\berkanan}{\textarc{b}}
    \newcommand{\ehwaz}{\textarc{e}}
    \newcommand{\mannaz}{\textarc{m}}
    \newcommand{\laguz}{\textarc{l}}
    \newcommand{\ingwaz}{\textarc{ŋ}}
    \newcommand{\dagaz}{\textarc{d}}
    \newcommand{\othila}{\textarc{o}}
\fi

\endinput