<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% Copyright at Nahid Hossain , Asst. Professor, UIU
% nahid@cse.uiu.ac.bd    / mailbox.nahid@gmail.com
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{bangla}[2023/02/02]
\RequirePackage{fontspec}
\RequirePackage{etoolbox}
\RequirePackage{polyglossia}
\RequirePackage{CharisSIL}

\setmainlanguage{english}
\setotherlanguage{bengali}
\newfontface\bdnhtranslitfont{CharisSIL-Regular.ttf}
\DeclareTextFontCommand{\translitfont}{\bdnhtranslitfont}
\newfontface\banglaipafont{CharisSIL-Regular.ttf}
\makeatletter
\def\zztable#1{#1}
\def\zzrow#1#2{\expandafter\gdef\csname B-#2\endcsname{#1}}
\def\banglaipa#1{{\banglaipafont\xgenerateTransliteration#1@}}
\def\xgenerateTransliteration{\futurelet\tmp\xxgenerateTransliteration}
\def\xxgenerateTransliteration{%
\ifx\tmp\@sptoken\space\fi
\xxxgenerateTransliteration
}
\def\xxxgenerateTransliteration#1{%
\expandafter\ifx\csname B-#1\endcsname\relax?%
\expandafter\show\csname B-#1\endcsname
\fi
\csname B-#1\endcsname
\xgenerateTransliteration}
\expandafter\def\csname B-@\endcsname#1{}
\input{banglamap}
\makeatother
\makeatletter
\long\def\@gobbletorelax#1\relax{}
\newcommand\bengalinum[1]{\expandafter\@bengalinum\csname c@#1\endcsname}
\newcommand\@bengalinum[1]{\expandafter\@bengalinum@\the#1\relax}
\newcommand\@bengalinum@[1]
  {%
    \@gobbletorelax#1\@bengalinum@end\relax
    \@bengalinum@digit{#1}%
  }
\newcommand\@bengalinum@digit[1]
  {%
    \ifcase#1
      \banglatext{爰ｦ}\or % 0
      \banglatext{爰ｧ}\or % 1
      \banglatext{爰ｨ}\or % 2
      \banglatext{爰ｩ}\or % 3
      \banglatext{爰ｪ}\or % 4
      \banglatext{爰ｫ}\or % 5
      \banglatext{爰ｬ}\or % 6
      \banglatext{爰ｭ}\or % 7
      \banglatext{爰ｮ}\or % 8
      \banglatext{爰ｯ}\fi % 9
    \@bengalinum@
  }
\def\@bengalinum@end#1\@bengalinum@digit#2{}
\makeatother
\newcommand{\banglapage}{\renewcommand\thepage{\bengalinum{page}}}
\newcommand{\banglasection}{\renewcommand\thesection{\bengalinum{section}}
\renewcommand\thesubsection{\thesection.\bengalinum{subsection}}
\renewcommand\thesubsubsection{\thesubsection.\bengalinum{subsubsection}}}
\newcommand{\banglaequation}{\renewcommand\theequation{\bengalinum{equation}}}
\newcommand{\banglatable}{\renewcommand\thetable{\bengalinum{table}}}
\newcommand{\banglafigure}{\renewcommand\thefigure{\bengalinum{figure}}}
\makeatletter
\long\def\@gobbletorelax#1\relax{}
\newcommand\bengalialpha[1]{\expandafter\@bengalialpha\csname c@#1\endcsname}
\newcommand\@bengalialpha[1]{\expandafter\@bengalialpha@\the#1\relax}
\newcommand\@bengalialpha@[1]
  {%
    \@gobbletorelax#1\@bengalialpha@end\relax
    \@bengalialpha@digit{#1}%
  }
\newcommand\@bengalialpha@digit[1]
  {%
    \ifcase#1
      \banglatext{爬扶\or % 0
      \banglatext{爬扶\or % 0
      \banglatext{爬凡\or % 1
      \banglatext{爬抑\or % 2
      \banglatext{爬�}\or % 3
      \banglatext{爬凩\or % 4
      \banglatext{爬嘲\or % 5
      \banglatext{爬孺\or % 6
      \banglatext{爬怡\or % 7
      \banglatext{爬掵\or % 8
      \banglatext{爬栲\fi % 9
    \@bengalialpha@
  }
\def\@bengalialpha@end#1\@bengalialpha@digit#2{}
\makeatother
\newcommand{\banglaenumerate}{\renewcommand\theenumi{\bengalinum{enumi}}\renewcommand\theenumii{\bengalialpha{enumii}}}
\ExplSyntaxOn
\tl_new:N \l_mytrans_tl

% transliteration
\NewDocumentCommand{\indictrans}{ m }
{
\tl_set:Nn \l_mytrans_tl { #1 }
\doindictrans
    { \translitfont
                    \tl_use:N \l_mytrans_tl
        }
}

% text (transliteration)
\NewDocumentCommand{\banglatranslit}{ m }
{
\tl_set:Nn \l_mytrans_tl { #1 }
\doindictrans
    { \translitfont
                    \tl_use:N \l_mytrans_tl
        } 
}

% multi-line environment
\NewDocumentEnvironment{isoindictranse}{ +b }
{
\tl_set:Nn \l_mytrans_tl { #1 }
\doindictrans
%\bengalifont
    { \translitfont
                    \tl_use:N \l_mytrans_tl
        }
}
{ }

% the mapping 
\newcommand\doindictrans{
\tl_replace_all:Nnn \l_mytrans_tl { 爰� } { r^^^^0323a } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬｡爬ｼ } { r^^^^0323a } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰� } { r^^^^0323ha } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬｢爬ｼ } { r^^^^0323ha } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰� } { y^^^^0307a}
\tl_replace_all:Nnn \l_mytrans_tl { 爬ｯ爬ｼ } { y^^^^0307a}  
\tl_replace_all:Nnn \l_mytrans_tl { 爬歩ｦｼ } { qa } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬籾ｦｼ } { kﾍ殄a } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬伶ｦｼ } { g^^^^0307a } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬憫ｦｼ } { za } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬ｫ爬ｼ } { fa } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { a } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { ﾄ� } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { i } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { ﾄｫ } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { u } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { ﾅｫ } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { rﾌ･ } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰� } { rﾌ･ﾌ� } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { lﾌ･ } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰｡ } { lﾌ･ﾌ� } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { ﾄ� } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { ai } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { ﾅ� } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { au } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { 盪� } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { mﾌ� } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { 盧･ } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { ka } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { kha } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { ga } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { gha } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { 盪�a } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { ca } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { cha } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { ja } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { jha } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { ﾃｱa } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { 盪ｭa } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬� } { 盪ｭha } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬｡ } { 盧溝 } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬｢ } { 盧紘a } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬｣ } { 盪㌢ } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬､ } { ta } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬･ } { tha } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬ｦ } { da } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬ｧ } { dha } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬ｨ } { na } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬ｪ } { pa } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬ｫ } { pha } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬ｬ } { ba } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬ｭ } { bha } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬ｮ } { ma } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬ｯ } { ya } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬ｰ } { ra } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰ｰ } { ra } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬ｲ } { la } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰ｱ } { va } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬ｶ } { ﾅ嫗 } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬ｷ } { 盪｣a } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬ｸ } { sa } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬ｹ } { ha } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬ｽ } { 窶� } 
\tl_replace_all:Nnn \l_mytrans_tl { 爭､ } { . } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬ｾ } { -ﾄ� } 
\tl_replace_all:Nnn \l_mytrans_tl { 爬ｿ } { -i } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰 } { -ﾄｫ } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰� } { -u } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰� } { -ﾅｫ } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰� } { -r } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰� } { -rr } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰� } { -e } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰� } { -ai } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰� } { -o } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰� } { -au } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰� } {  virama } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰� } { t } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰� } { - } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰ｦ } { 0 } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰ｧ } { 1 } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰ｨ } { 2 } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰ｩ } { 3 } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰ｪ } { 4 } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰ｫ } { 5 } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰ｬ } { 6 } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰ｭ } { 7 } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰ｮ } { 8 } 
\tl_replace_all:Nnn \l_mytrans_tl { 爰ｯ } { 9 } 


% tidy-up: inherent a, etc
\regex_replace_all:nnN { a\-(ai) } { \1 } \l_mytrans_tl
\regex_replace_all:nnN { a\-(au) } { \1 } \l_mytrans_tl
\regex_replace_all:nnN { a\-([ﾄ（ueoﾄｫﾅｫ]{1}) } { \1 } \l_mytrans_tl
\regex_replace_all:nnN { a\-(rr) } { \1 } \l_mytrans_tl
\regex_replace_all:nnN { a\-(r) } { \1 } \l_mytrans_tl
\tl_replace_all:Nnn \l_mytrans_tl { avirama } { } 
\tl_replace_all:Nnn \l_mytrans_tl { 盪� } { ng } 
\regex_replace_all:nnN { \-([ﾄ（ueoﾄｫﾅｫ]{1}) } { \1 } \l_mytrans_tl
%...
}
\ExplSyntaxOff

\newtoggle{langen}
\DeclareOption{shimanto}{\newcommand{\fooA}{font1}}
\DeclareOption{notosansbengali}{\newcommand{\fooA}{font2}}
\DeclareOption{notoserifbengali}{\newcommand{\fooA}{font3}}
\DeclareOption{kalpurush}{\newcommand{\fooA}{font4}}
\ProcessOptions

\ifdefstring{\fooA}{font1}{
\newfontface{\bdnhtext}{fontshimanto.ttf}
\DeclareTextFontCommand{\banglatext}{\bdnhtext}
\newfontfamily{\bdnhbold}{fontshimanto.ttf}[FakeBold=4.0]
\DeclareTextFontCommand{\banglabold}{\bdnhbold}
\newfontfamily{\bdnhitalic}{fontshimanto.ttf}[FakeSlant=0.2]
\DeclareTextFontCommand{\banglaitalic}{\bdnhitalic}
}
{
    \ifdefstring{\fooA}{font2}{
            \newfontface{\bdnhtext}{Noto Sans Bengali}
            \DeclareTextFontCommand{\banglatext}{\bdnhtext}
            \newfontfamily{\bdnhbold}{Noto Sans Bengali}[FakeBold=4.0]
            \DeclareTextFontCommand{\banglabold}{\bdnhbold}
            \newfontfamily{\bdnhitalic}{Noto Sans Bengali}[FakeSlant=0.2]
            \DeclareTextFontCommand{\banglaitalic}{\bdnhitalic}
    }
    {
        \ifdefstring{\fooA}{font3}{
            \newfontface{\bdnhtext}{Noto Serif Bengali}
            \DeclareTextFontCommand{\banglatext}{\bdnhtext}
            \newfontfamily{\bdnhbold}{Noto Serif Bengali}[FakeBold=4.0]
            \DeclareTextFontCommand{\banglabold}{\bdnhbold}
            \newfontfamily{\bdnhitalic}{Noto Serif Bengali}[FakeSlant=0.2]
            \DeclareTextFontCommand{\banglaitalic}{\bdnhitalic}
        }
        {
            \ifdefstring{\fooA}{font4}{
            \newfontface{\bdnhtext}{fontkalpurush.ttf}
            \DeclareTextFontCommand{\banglatext}{\bdnhtext}
             \newfontfamily{\bdnhbold}{fontkalpurush.ttf}[FakeBold=4.0]
             \DeclareTextFontCommand{\banglabold}{\bdnhbold}
             \newfontfamily{\bdnhitalic}{fontkalpurush.ttf}[FakeSlant=0.2]
             \DeclareTextFontCommand{\banglaitalic}{\bdnhitalic}
            }
            {
             \newfontface{\bdnhtext}{fontkalpurush.ttf}
            \DeclareTextFontCommand{\banglatext}{\bdnhtext}
             \newfontfamily{\bdnhbold}{fontkalpurush.ttf}[FakeBold=4.0]
             \DeclareTextFontCommand{\banglabold}{\bdnhbold}
             \newfontfamily{\bdnhitalic}{fontkalpurush.ttf}[FakeSlant=0.2]
             \DeclareTextFontCommand{\banglaitalic}{\bdnhitalic}
            }
             
        }
    }

}
\newcommand{\banglaallcounters}{\banglapage \banglasection \banglaenumerate \banglaequation \banglatable \banglafigure}

</pre></body></html>