From ba5b524ffb7b31ed52f06d40fa7cd2877124e46a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 6 Sep 2020 21:14:06 +0000 Subject: akshar (6sep20) git-svn-id: svn://tug.org/texlive/trunk@56277 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/akshar/README.txt | 2 +- Master/texmf-dist/doc/latex/akshar/akshar.pdf | Bin 147111 -> 147043 bytes Master/texmf-dist/source/latex/akshar/HackNF_B.ttf | Bin 0 -> 1789212 bytes .../texmf-dist/source/latex/akshar/HackNF_BI.ttf | Bin 0 -> 1792180 bytes Master/texmf-dist/source/latex/akshar/HackNF_I.ttf | Bin 0 -> 1748544 bytes Master/texmf-dist/source/latex/akshar/HackNF_R.ttf | Bin 0 -> 1741792 bytes Master/texmf-dist/source/latex/akshar/akshar.dtx | 143 +++++++++++---------- Master/texmf-dist/source/latex/akshar/akshar.ins | 2 +- .../texmf-dist/source/latex/akshar/siddhanta.ttf | Bin 0 -> 1168564 bytes Master/texmf-dist/tex/latex/akshar/akshar.sty | 36 ++++-- 10 files changed, 99 insertions(+), 84 deletions(-) create mode 100644 Master/texmf-dist/source/latex/akshar/HackNF_B.ttf create mode 100644 Master/texmf-dist/source/latex/akshar/HackNF_BI.ttf create mode 100644 Master/texmf-dist/source/latex/akshar/HackNF_I.ttf create mode 100644 Master/texmf-dist/source/latex/akshar/HackNF_R.ttf create mode 100644 Master/texmf-dist/source/latex/akshar/siddhanta.ttf (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/latex/akshar/README.txt b/Master/texmf-dist/doc/latex/akshar/README.txt index 8a015bdcbf0..03b43f37660 100644 --- a/Master/texmf-dist/doc/latex/akshar/README.txt +++ b/Master/texmf-dist/doc/latex/akshar/README.txt @@ -1,6 +1,6 @@ Package: akshar Author: Vu Van Dung -Version: 0.1 (23 May 2020) +Version: 0.2 (06 Sep 2020) Description: Support for syllables in the Devanagari script Repository: https://github.com/joulev/akshar Bug tracker: https://github.com/joulev/akshar/issues diff --git a/Master/texmf-dist/doc/latex/akshar/akshar.pdf b/Master/texmf-dist/doc/latex/akshar/akshar.pdf index cfc0247e97f..a6b9b8c46cb 100644 Binary files a/Master/texmf-dist/doc/latex/akshar/akshar.pdf and b/Master/texmf-dist/doc/latex/akshar/akshar.pdf differ diff --git a/Master/texmf-dist/source/latex/akshar/HackNF_B.ttf b/Master/texmf-dist/source/latex/akshar/HackNF_B.ttf new file mode 100644 index 00000000000..290d487c979 Binary files /dev/null and b/Master/texmf-dist/source/latex/akshar/HackNF_B.ttf differ diff --git a/Master/texmf-dist/source/latex/akshar/HackNF_BI.ttf b/Master/texmf-dist/source/latex/akshar/HackNF_BI.ttf new file mode 100644 index 00000000000..8dc2d8a5d86 Binary files /dev/null and b/Master/texmf-dist/source/latex/akshar/HackNF_BI.ttf differ diff --git a/Master/texmf-dist/source/latex/akshar/HackNF_I.ttf b/Master/texmf-dist/source/latex/akshar/HackNF_I.ttf new file mode 100644 index 00000000000..d1d70676c04 Binary files /dev/null and b/Master/texmf-dist/source/latex/akshar/HackNF_I.ttf differ diff --git a/Master/texmf-dist/source/latex/akshar/HackNF_R.ttf b/Master/texmf-dist/source/latex/akshar/HackNF_R.ttf new file mode 100644 index 00000000000..d770b830ccd Binary files /dev/null and b/Master/texmf-dist/source/latex/akshar/HackNF_R.ttf differ diff --git a/Master/texmf-dist/source/latex/akshar/akshar.dtx b/Master/texmf-dist/source/latex/akshar/akshar.dtx index 2a252c34c81..54425516c05 100644 --- a/Master/texmf-dist/source/latex/akshar/akshar.dtx +++ b/Master/texmf-dist/source/latex/akshar/akshar.dtx @@ -25,7 +25,14 @@ % akshar.ins % and the derived file akshar.sty. % --------------------------------------------------------------------------- -% +% The manual uses the following fonts: +% * Siddhanta for serif font. +% Source: https://sites.google.com/site/bayaryn +% * Biolinum for sans font. +% Source: Package libertine (https://ctan.org/pkg/libertine) +% * Hack Nerd Font for monospace font. +% Source: https://www.nerdfonts.com/font-downloads +% --------------------------------------------------------------------------- % \fi % \iffalse %<*internal> @@ -34,7 +41,7 @@ %<*readme> Package: akshar Author: Vu Van Dung -Version: 0.1 (23 May 2020) +Version: 0.2 (06 Sep 2020) Description: Support for syllables in the Devanagari script Repository: https://github.com/joulev/akshar Bug tracker: https://github.com/joulev/akshar/issues @@ -46,8 +53,8 @@ License: The LaTeX Project Public License v1.3c or later. % %<*driver|package> \def\aksharPackageName{akshar} -\def\aksharPackageVersion{0.1} -\def\aksharPackageDate{2020/05/23} +\def\aksharPackageVersion{0.2} +\def\aksharPackageDate{2020/09/06} \def\aksharPackageDescription{Support for syllables in the Devanagari script (JV)} % %<*driver> @@ -55,15 +62,23 @@ License: The LaTeX Project Public License v1.3c or later. \renewcommand\MacroLongFont{\ttfamily\small} \usepackage[margin=1cm,left=7cm,bottom=1.5cm]{geometry} \usepackage{fontspec} -\setmainfont[Scale=0.9,Script=Devanagari]{Siddhanta} -\setsansfont[Scale=1.1]{Linux Biolinum} -\setmonofont[Scale=0.85]{Hack NF} -\newfontfamily{\aksharDocFontFallback}{Siddhanta} +\usepackage{biolinum} +\setmainfont{siddhanta}[Scale=0.9, + Script=Devanagari, + Extension=.ttf] +\setmonofont{HackNF}[Scale=0.85, + Extension=.ttf, + UprightFont=*_R, + BoldFont=*_B, + ItalicFont=*_I, + BoldItalicFont=*_BI] +\newfontfamily{\aksharDocFontFallback}{siddhanta} + [Scale=0.9,Script=Devanagari,Extension=.ttf] \usepackage[libertine]{newtxmath} \renewcommand\meta[1]{$\langle${\itshape\rmfamily#1}$\rangle$} \usepackage{newunicodechar} \ExplSyntaxOn -\tl_map_inline:nn { ािीुूेैोौंःॢृॅँ़ॆॊॉॎॏ॓ॕॖॗॄऺऻ꣠꣡꣢꣣꣤꣥꣦꣧꣨꣩꣪꣫꣬꣭꣮꣯꣰꣱ꣿ्कनमस्कारमंळीममडळीममडमंमममडडमंळीममडममंममडडमंळीममड } +\tl_map_inline:nn { ािीुूेैोौंःॢृॅँ़ॆॊॉॎॏ॓ॕॖॗॄऺऻ꣠꣡꣢꣣꣤꣥꣦꣧꣨꣩꣪꣫꣬꣭꣮꣯꣰꣱ꣿ्कनमस्कारमंळीममडळीममडमंमममडडमंळीममडममंममडडमंळीममड ॑ ॒ ॓ ॔} { \newunicodechar{#1}{{\iffontchar\font`#1\else\aksharDocFontFallback\fi#1}} } \ExplSyntaxOff \usepackage{akshar} @@ -111,6 +126,7 @@ License: The LaTeX Project Public License v1.3c or later. % \date^^A % {^^A % Version \aksharPackageVersion\ --- \aksharPackageDate\\[1ex]^^A +% {\small\faIcon{link}\quad\url{https://ctan.org/pkg/akshar}}\\^^A % {\small\faIcon{github}\quad\url{https://github.com/joulev/akshar}}^^A % } % @@ -147,6 +163,10 @@ License: The LaTeX Project Public License v1.3c or later. % front-end macros for some simple actions on the input string. % % \section{User manual} +% +% Due to the current implementation, \emph{all} of these macros and functions +% are \emph{not} expandable. +% % \subsection{\LaTeXe\ macros}\label{latex2e-macros} % \begin{function}{\aksharStrLen} % \begin{syntax} @@ -206,9 +226,9 @@ License: The LaTeX Project Public License v1.3c or later. %\tl_set:Nn \l_tmpa_tl { मममडडमंळीममड } %\tl_replace_all:Nnn \l_tmpa_tl { म } { स्का } %\tl_use:N \l_tmpa_tl\par -%\cs{aksharStrReplace} ~ output:\par -%\aksharStrReplace { मममडडमंळीममड } { म } { स्का } %\ExplSyntaxOff +%\cs{aksharStrReplace} output:\par +%\aksharStrReplace { मममडडमंळीममड } { म } { स्का } % \end{codeexample} % \begin{codeexample}[] %\ExplSyntaxOn @@ -216,9 +236,9 @@ License: The LaTeX Project Public License v1.3c or later. %\tl_set:Nn \l_tmpa_tl { ममंममडडमंळीममड } %\tl_replace_once:Nnn \l_tmpa_tl { मम } { स्का } %\tl_use:N \l_tmpa_tl\par -%\cs{aksharStrReplace*} ~ output:\par -%\aksharStrReplace* { ममंममडडमंळीममड } { मम } { स्का } %\ExplSyntaxOff +%\cs{aksharStrReplace*} output:\par +%\aksharStrReplace* { ममंममडडमंळीममड } { मम } { स्का } % \end{codeexample} % \begin{function}{\aksharStrRemove, \aksharStrRemove*} % \begin{syntax} @@ -236,9 +256,9 @@ License: The LaTeX Project Public License v1.3c or later. %\tl_set:Nn \l_tmpa_tl { मममडडमंळीममड } %\tl_remove_all:Nn \l_tmpa_tl { म } %\tl_use:N \l_tmpa_tl\par -%\cs{aksharStrRemove} ~ output:\par -%\aksharStrRemove { मममडडमंळीममड } { म } %\ExplSyntaxOff +%\cs{aksharStrRemove} output:\par +%\aksharStrRemove { मममडडमंळीममड } { म } % \end{codeexample} % \begin{codeexample}[] %\ExplSyntaxOn @@ -246,9 +266,9 @@ License: The LaTeX Project Public License v1.3c or later. %\tl_set:Nn \l_tmpa_tl { ममंममडडमंळीममड } %\tl_remove_once:Nn \l_tmpa_tl { मम } %\tl_use:N \l_tmpa_tl\par -%\cs{aksharStrRemove*} ~ output:\par -%\aksharStrRemove* { ममंममडडमंळीममड } { मम } %\ExplSyntaxOff +%\cs{aksharStrRemove*} output:\par +%\aksharStrRemove* { ममंममडडमंळीममड } { मम } % \end{codeexample} % \subsection{\pkg{expl3} functions} % This section assumes that you have a basic knowledge in \LaTeX3 programming. @@ -261,8 +281,7 @@ License: The LaTeX Project Public License v1.3c or later. % \cs{akshar_convert:Nn} \meta{seq var} \marg{token list} % \end{syntax} % This function converts \meta{token list} to a sequence of characters, that -% sequence is stored in \meta{seq var}. The assignment to \meta{seq var} is -% local to the current \TeX\ group. +% sequence is stored in \meta{seq var}. % \end{function} % \begin{codeexample}[] %\ExplSyntaxOn @@ -301,9 +320,10 @@ License: The LaTeX Project Public License v1.3c or later. \tl_const:Nn \c_@@_joining_tl { ्} \tl_const:Nn \c_@@_diacritics_tl { - ा, ि, ी, ु, ू, े, ै, ो, ौ, ं, ः, ॢ, ृ, ॅ, ँ, ़, ॆ, ॊ, - ॉ, ॎ, ॏ, ॑, ॒, ॓, ॔, ॕ, ॖ, ॗ, ॄ, ऺ, ऻ, ꣠, ꣡, ꣢, ꣣, ꣤, ꣥, - ꣦, ꣧, ꣨, ꣩, ꣪, ꣫, ꣬, ꣭, ꣮, ꣯, ꣰, ꣱, ꣿ + ा, ि, ी, ु, ू, े, ै, ो, ौ, ं, ः, ॢ, ृ, + ॅ, ँ, ़, ॆ, ॊ, ॉ, ॎ, ॏ, ॑, ॒, ॓, ॔, ॕ, ॖ, ॗ, + ॄ, ऺ, ऻ, ꣠, ꣡, ꣢, ꣣, ꣤, ꣥, ꣦, ꣧, ꣨, ꣩, ꣪, + ꣫, ꣬, ꣭, ꣮, ꣯, ꣰, ꣱, ꣿ } % \end{macrocode} % \end{variable} @@ -321,6 +341,14 @@ License: The LaTeX Project Public License v1.3c or later. \seq_new:N \l_@@_char_seq % \end{macrocode} % \end{variable} +% \begin{variable}{\c_@@_str_g_tl, \c_@@_str_seq_tl, \c_@@_str_comma_tl} +% Some self-descriptive constant variables. +% \begin{macrocode} +\tl_const:Nx \c_@@_str_g_tl { \tl_to_str:n {g} } +\tl_const:Nx \c_@@_str_seq_tl { \tl_to_str:n {seq} } +\tl_const:Nx \c_@@_str_comma_tl { \tl_to_str:n {,} } +% \end{macrocode} +% \end{variable} % \begin{variable}{\l_@@_tmpa_tl, \l_@@_tmpb_tl, \l_@@_tmpa_seq, \l_@@_tmpb_seq, % \l_@@_tmpc_seq, \l_@@_tmpd_seq, \l_@@_tmpe_seq, % \l_@@_tmpa_int, \l_@@_tmpb_int} @@ -379,12 +407,7 @@ License: The LaTeX Project Public License v1.3c or later. } % \end{macrocode} % \subsection{Utilities} -% ^^A Remove "This function is documented on page ??" -% \ExplSyntaxOn -% \cs_set_protected:Npn \__codedoc_print_documented: -% { \seq_gclear:N \g__codedoc_nested_names_seq } -% \ExplSyntaxOff -% \begin{macro}[TF]{\tl_if_in:No} +% \begin{macro}[TF,internal]{\tl_if_in:No} % When we get to a character which is not the joining one, we need to know if % it is a diacritic. The current character is stored in a variable, so an % expanded variant is needed. We only need it to expand only \textbf{o}nce. @@ -392,13 +415,13 @@ License: The LaTeX Project Public License v1.3c or later. \prg_generate_conditional_variant:Nnn \tl_if_in:Nn { No } { TF } % \end{macrocode} % \end{macro} -% \begin{macro}{\seq_set_split:Nxx} +% \begin{macro}[internal]{\seq_set_split:Nxx} % A variant we will need in \cs{@@_var_if_global}. % \begin{macrocode} \cs_generate_variant:Nn \seq_set_split:Nnn { Nxx } % \end{macrocode} % \end{macro} -% \begin{macro}{\msg_error:nnx, \msg_error:nnnxx} +% \begin{macro}[internal]{\msg_error:nnx, \msg_error:nnnxx} % Some variants of \pkg{l3msg} functions that we will need when issuing error % messages. % \begin{macrocode} @@ -406,20 +429,28 @@ License: The LaTeX Project Public License v1.3c or later. \cs_generate_variant:Nn \msg_error:nnnnn { nnnxx } % \end{macrocode} % \end{macro} +% \begin{macro}[TF]{\@@_tl_if_in_ncomma:NN} +% This conditional is essentially \cs{tl_if_in:Nn}, but if |#2| is a comma this +% conditional always return false. +% \begin{macrocode} +\prg_new_conditional:Npnn \@@_tl_if_in_ncomma:NN #1 #2 { T, F, TF } + { + \tl_if_eq:NNTF \c_@@_str_comma_tl #2 { \prg_return_false: } + { \tl_if_in:NoTF #1 {#2} { \prg_return_true: } { \prg_return_false: } } + } +% \end{macrocode} +% \end{macro} % \begin{macro}[TF]{\@@_var_if_global:N} -% \begin{variable}{\c_@@_str_g_tl, \c_@@_str_seq_tl} % This conditional checks if |#1| is a global sequence variable or not. In other % words, it returns true iff |#1| is a control sequence in the format % |\g_|\meta{name}|_seq|. If it is not a sequence variable, this function will % (TODO) issue an error message. % \begin{macrocode} -\tl_const:Nx \c_@@_str_g_tl { \tl_to_str:n {g} } -\tl_const:Nx \c_@@_str_seq_tl { \tl_to_str:n {seq} } \prg_new_conditional:Npnn \@@_var_if_global:N #1 { T, F, TF } { \bool_if:nTF { \exp_last_unbraced:Nf \use_iii:nnn { \cs_split_function:N #1 } } - { + { \msg_error:nnx { akshar } { err_not_a_sequence_variable } { \token_to_str:N #1 } \prg_return_false: @@ -442,7 +473,6 @@ License: The LaTeX Project Public License v1.3c or later. } } % \end{macrocode} -% \end{variable} % \end{macro} % \begin{macro}{\@@_int_append_ordinal:n} % Append st, nd, rd or th to interger |#1|. Will be needed in error messages. @@ -481,35 +511,11 @@ License: The LaTeX Project Public License v1.3c or later. } % \end{macrocode} % \end{macro} -% ^^A Restore the status quo -% \ExplSyntaxOn -% \cs_set_protected:Npn \__codedoc_print_documented: -% { -% \seq_gset_filter:NNn \g__codedoc_nested_names_seq -% \g__codedoc_nested_names_seq -% { ! \__codedoc_if_macro_internal_p:n {##1} } -% \seq_if_empty:NF \g__codedoc_nested_names_seq -% { -% \int_set:Nn \l__codedoc_tmpa_int -% { \seq_count:N \g__codedoc_nested_names_seq } -% \int_compare:nNnTF \l__codedoc_tmpa_int = 1 {~This~} {~These~} -% \bool_if:NTF \l__codedoc_macro_var_bool {variable} {function} -% \int_compare:nNnTF \l__codedoc_tmpa_int = 1 {~is~} {s~are~} -% documented~on~page~ -% \__codedoc_get_hyper_target:xN -% { \seq_item:Nn \g__codedoc_nested_names_seq { 1 } } -% \l__codedoc_tmpa_tl -% \exp_args:Nx \pageref { \l__codedoc_tmpa_tl } . -% } -% \seq_gclear:N \g__codedoc_nested_names_seq -% } -% \ExplSyntaxOff % \subsection{The \cs{akshar_convert:Nn} function and its variants} % \begin{macro}{\akshar_convert:Nn, \akshar_convert:cn, % \akshar_convert:Nx, \akshar_convert:cx} % This converts |#2| to a sequence of \emph{true} Devanagari characters. The -% sequence is set to |#1|, which should be a sequence variable. The assignment -% is local. +% sequence is set to |#1|, which should be a sequence variable. % \begin{macrocode} \cs_new:Npn \akshar_convert:Nn #1 #2 { @@ -524,7 +530,8 @@ License: The LaTeX Project Public License v1.3c or later. % \begin{macrocode} \tl_map_variable:NNn {#2} \l_@@_map_tl { - \tl_if_in:NoTF \c_@@_diacritics_tl {\l_@@_map_tl} + \@@_tl_if_in_ncomma:NNTF + \c_@@_diacritics_tl \l_@@_map_tl { % \end{macrocode} % It is a diacritic. We append the current diacritic to the last item of the @@ -709,7 +716,7 @@ License: The LaTeX Project Public License v1.3c or later. % \begin{macro}{\aksharStrLen} % Expands to the length of the string. % \begin{macrocode} -\NewExpandableDocumentCommand \aksharStrLen {m} +\NewDocumentCommand \aksharStrLen {m} { \akshar_convert:Nn \l_@@_tmpa_seq {#1} \seq_count:N \l_@@_tmpa_seq @@ -719,7 +726,7 @@ License: The LaTeX Project Public License v1.3c or later. % \begin{macro}{\aksharStrChar} % Returns the $n$-th character of the string. % \begin{macrocode} -\NewExpandableDocumentCommand \aksharStrChar {mm} +\NewDocumentCommand \aksharStrChar {mm} { \akshar_convert:Nn \l_@@_tmpa_seq {#1} \bool_if:nTF @@ -740,7 +747,7 @@ License: The LaTeX Project Public License v1.3c or later. % \begin{macro}{\aksharStrHead} % Return the first character of the string. % \begin{macrocode} -\NewExpandableDocumentCommand \aksharStrHead {m} +\NewDocumentCommand \aksharStrHead {m} { \akshar_convert:Nn \l_@@_tmpa_seq {#1} \int_compare:nNnTF { \seq_count:N \l_@@_tmpa_seq } = {0} @@ -756,7 +763,7 @@ License: The LaTeX Project Public License v1.3c or later. % \begin{macro}{\aksharStrTail} % Return the last character of the string. % \begin{macrocode} -\NewExpandableDocumentCommand \aksharStrTail {m} +\NewDocumentCommand \aksharStrTail {m} { \akshar_convert:Nn \l_@@_tmpa_seq {#1} \int_compare:nNnTF { \seq_count:N \l_@@_tmpa_seq } = {0} @@ -772,7 +779,7 @@ License: The LaTeX Project Public License v1.3c or later. % \begin{macro}{\aksharStrReplace, \aksharStrReplace*} % Replace occurences of |#3| of a string |#2| with another string |#4|. % \begin{macrocode} -\NewExpandableDocumentCommand \aksharStrReplace {smmm} +\NewDocumentCommand \aksharStrReplace {smmm} { \IfBooleanTF {#1} { @@ -791,7 +798,7 @@ License: The LaTeX Project Public License v1.3c or later. % Remove occurences of |#3| in |#2|. This is just a special case of % \cs{aksharStrReplace}. % \begin{macrocode} -\NewExpandableDocumentCommand \aksharStrRemove {smm} +\NewDocumentCommand \aksharStrRemove {smm} { \IfBooleanTF {#1} { @@ -811,4 +818,4 @@ License: The LaTeX Project Public License v1.3c or later. % \end{macrocode} % \end{implementation} % -% \Finale \ No newline at end of file +% \Finale diff --git a/Master/texmf-dist/source/latex/akshar/akshar.ins b/Master/texmf-dist/source/latex/akshar/akshar.ins index f6a0cbc8099..b5c73a6d429 100644 --- a/Master/texmf-dist/source/latex/akshar/akshar.ins +++ b/Master/texmf-dist/source/latex/akshar/akshar.ins @@ -44,4 +44,4 @@ and the derived file akshar.sty. \file{README.txt}{\from{\jobname.dtx}{readme}} } -\endbatchfile \ No newline at end of file +\endbatchfile diff --git a/Master/texmf-dist/source/latex/akshar/siddhanta.ttf b/Master/texmf-dist/source/latex/akshar/siddhanta.ttf new file mode 100644 index 00000000000..84ce187ee99 Binary files /dev/null and b/Master/texmf-dist/source/latex/akshar/siddhanta.ttf differ diff --git a/Master/texmf-dist/tex/latex/akshar/akshar.sty b/Master/texmf-dist/tex/latex/akshar/akshar.sty index f3bf2b5d9cb..504c78abb62 100644 --- a/Master/texmf-dist/tex/latex/akshar/akshar.sty +++ b/Master/texmf-dist/tex/latex/akshar/akshar.sty @@ -32,8 +32,8 @@ %% --------------------------------------------------------------------------- %% \def\aksharPackageName{akshar} -\def\aksharPackageVersion{0.1} -\def\aksharPackageDate{2020/05/23} +\def\aksharPackageVersion{0.2} +\def\aksharPackageDate{2020/09/06} \def\aksharPackageDescription{Support for syllables in the Devanagari script (JV)} \RequirePackage{fontspec} \ProvidesExplPackage {\aksharPackageName} @@ -41,12 +41,16 @@ \tl_const:Nn \c__akshar_joining_tl { ्} \tl_const:Nn \c__akshar_diacritics_tl { - ा, ि, ी, ु, ू, े, ै, ो, ौ, ं, ः, ॢ, ृ, ॅ, ँ, ़, ॆ, ॊ, - ॉ, ॎ, ॏ, ॑, ॒, ॓, ॔, ॕ, ॖ, ॗ, ॄ, ऺ, ऻ, ꣠, ꣡, ꣢, ꣣, ꣤, ꣥, - ꣦, ꣧, ꣨, ꣩, ꣪, ꣫, ꣬, ꣭, ꣮, ꣯, ꣰, ꣱, ꣿ + ा, ि, ी, ु, ू, े, ै, ो, ौ, ं, ः, ॢ, ृ, + ॅ, ँ, ़, ॆ, ॊ, ॉ, ॎ, ॏ, ॑, ॒, ॓, ॔, ॕ, ॖ, ॗ, + ॄ, ऺ, ऻ, ꣠, ꣡, ꣢, ꣣, ꣤, ꣥, ꣦, ꣧, ꣨, ꣩, ꣪, + ꣫, ꣬, ꣭, ꣮, ꣯, ꣰, ꣱, ꣿ } \bool_new:N \l__akshar_prev_joining_bool \seq_new:N \l__akshar_char_seq +\tl_const:Nx \c__akshar_str_g_tl { \tl_to_str:n {g} } +\tl_const:Nx \c__akshar_str_seq_tl { \tl_to_str:n {seq} } +\tl_const:Nx \c__akshar_str_comma_tl { \tl_to_str:n {,} } \tl_new:N \l__akshar_tmpa_tl \tl_new:N \l__akshar_tmpb_tl \seq_new:N \l__akshar_tmpa_seq @@ -88,8 +92,11 @@ \cs_generate_variant:Nn \seq_set_split:Nnn { Nxx } \cs_generate_variant:Nn \msg_error:nnn { nnx } \cs_generate_variant:Nn \msg_error:nnnnn { nnnxx } -\tl_const:Nx \c__akshar_str_g_tl { \tl_to_str:n {g} } -\tl_const:Nx \c__akshar_str_seq_tl { \tl_to_str:n {seq} } +\prg_new_conditional:Npnn \__akshar_tl_if_in_ncomma:NN #1 #2 { T, F, TF } + { + \tl_if_eq:NNTF \c__akshar_str_comma_tl #2 { \prg_return_false: } + { \tl_if_in:NoTF #1 {#2} { \prg_return_true: } { \prg_return_false: } } + } \prg_new_conditional:Npnn \__akshar_var_if_global:N #1 { T, F, TF } { \bool_if:nTF @@ -154,7 +161,8 @@ \bool_set_false:N \l__akshar_prev_joining_bool \tl_map_variable:NNn {#2} \l__akshar_map_tl { - \tl_if_in:NoTF \c__akshar_diacritics_tl {\l__akshar_map_tl} + \__akshar_tl_if_in_ncomma:NNTF + \c__akshar_diacritics_tl \l__akshar_map_tl { \seq_pop_right:NN \l__akshar_char_seq \l__akshar_tmpa_tl \seq_put_right:Nx \l__akshar_char_seq @@ -260,12 +268,12 @@ { \seq_gset_eq:NN #1 \l__akshar_tmpa_seq } { \seq_set_eq:NN #1 \l__akshar_tmpa_seq } } -\NewExpandableDocumentCommand \aksharStrLen {m} +\NewDocumentCommand \aksharStrLen {m} { \akshar_convert:Nn \l__akshar_tmpa_seq {#1} \seq_count:N \l__akshar_tmpa_seq } -\NewExpandableDocumentCommand \aksharStrChar {mm} +\NewDocumentCommand \aksharStrChar {mm} { \akshar_convert:Nn \l__akshar_tmpa_seq {#1} \bool_if:nTF @@ -281,7 +289,7 @@ \scan_stop: } } -\NewExpandableDocumentCommand \aksharStrHead {m} +\NewDocumentCommand \aksharStrHead {m} { \akshar_convert:Nn \l__akshar_tmpa_seq {#1} \int_compare:nNnTF { \seq_count:N \l__akshar_tmpa_seq } = {0} @@ -292,7 +300,7 @@ } { \seq_item:Nn \l__akshar_tmpa_seq { 1 } } } -\NewExpandableDocumentCommand \aksharStrTail {m} +\NewDocumentCommand \aksharStrTail {m} { \akshar_convert:Nn \l__akshar_tmpa_seq {#1} \int_compare:nNnTF { \seq_count:N \l__akshar_tmpa_seq } = {0} @@ -303,7 +311,7 @@ } { \seq_item:Nn \l__akshar_tmpa_seq {\seq_count:N \l__akshar_tmpa_seq} } } -\NewExpandableDocumentCommand \aksharStrReplace {smmm} +\NewDocumentCommand \aksharStrReplace {smmm} { \IfBooleanTF {#1} { @@ -316,7 +324,7 @@ } \seq_use:Nn \l__akshar_tmpa_seq {} } -\NewExpandableDocumentCommand \aksharStrRemove {smm} +\NewDocumentCommand \aksharStrRemove {smm} { \IfBooleanTF {#1} { -- cgit v1.2.3