% beuron.sty
% Paket für die Schrift der Beuroner Kunstschule
% Beuronese art script package
% Version 1.1
% Autor: Keno Wehr
% 11. September 2016
% U.I.O.G.D.

% 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.


\RequirePackage{expl3}
\ProvidesExplPackage {beuron} {2016/09/11} {1.1} {Beuronese art script package}

\RequirePackage{xparse}

% #1: Sollen Leerzeichen erhalten bleiben?
% #2: Text
\cs_new_protected:Npn \beuron_replace:nn #1#2
    {
        \tl_set:Nn \l_tmpa_tl {#2}
        \tl_replace_all:Nnn \l_tmpa_tl {Ä} {AE}
        \tl_replace_all:Nnn \l_tmpa_tl {ä} {AE}
        \tl_replace_all:Nnn \l_tmpa_tl {Ö} {OE}
        \tl_replace_all:Nnn \l_tmpa_tl {ö} {OE}
        \tl_replace_all:Nnn \l_tmpa_tl {Ü} {UE}
        \tl_replace_all:Nnn \l_tmpa_tl {ü} {UE}
        \tl_replace_all:Nnn \l_tmpa_tl {ß} {SS}

        \bool_if:NF #1
            {
                \tl_replace_all:Nnn \l_tmpa_tl {~} {\slash}
            }

        \MakeUppercase{\l_tmpa_tl}
    }

\NewDocumentCommand \textbeuron {s m}
    {
        \group_begin:
        \usefont{T1}{beuron}{m}{n}
        \beuron_replace:nn {#1}{#2}
        \group_end:
    }

\NewDocumentCommand \textbeuronc {s m}
    {
        \group_begin:
        \usefont{T1}{beuron}{c}{n}
        \beuron_replace:nn {#1}{#2}
        \group_end:
    }

\NewDocumentCommand \textbeuronx {s m}
    {
        \group_begin:
        \usefont{T1}{beuron}{x}{n}
        \beuron_replace:nn {#1}{#2}
        \group_end:
    }

\NewDocumentCommand \beuronOmega { }
    {
        \group_begin:
		\fontencoding{T1}
        \fontfamily{beuron}
        \selectfont
		\symbol{10}
        \group_end:
    }
