<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ÍŸha } 
\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 { à§&nbsp; } { 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 { à¦&nbsp; } { á¹­ha } 
\tl_replace_all:Nnn \l_mytrans_tl { à¦¡ } { á¸a } 
\tl_replace_all:Nnn \l_mytrans_tl { à¦¢ } { á¸ha } 
\tl_replace_all:Nnn \l_mytrans_tl { à¦£ } { á¹‡a } 
\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 { à¦¶ } { Å›a } 
\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\-([ÄiueoÄ«Å«]{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 { \-([ÄiueoÄ«Å«]{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>