diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf')
-rw-r--r-- | Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf | 50 |
1 files changed, 34 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf index 7d38e3b0b7d..daa34b398d2 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-sanskrit.ldf @@ -9,6 +9,7 @@ and may look very wrong.} \RequirePackage{devanagaridigits} \PolyglossiaSetup{sanskrit}{ + bcp47=sa-Deva, langtag=SAN, hyphennames={sanskrit,prakrit}, hyphenmins={1,3}, @@ -17,6 +18,16 @@ and may look very wrong.} localnumeral=sanskritnumerals } +% BCP-47 compliant aliases +\setlanguagealias*{sanskrit}{sa} +\setlanguagealias*[script=Devanagari]{sanskrit}{sa-Deva} +\setlanguagealias*[script=Malayalam]{sanskrit}{sa-Mlym} +\setlanguagealias*[script=Telugu]{sanskrit}{sa-Telu} +\setlanguagealias*[script=Bengali]{sanskrit}{sa-Beng} +\setlanguagealias*[script=Kannada]{sanskrit}{sa-Knda} +\setlanguagealias*[script=Gujarati]{sanskrit}{sa-Gujr} +\setlanguagealias*[script=Latin]{sanskrit}{sa-Latn} + \define@key{sanskrit}{Script}[Devanagari]{% \ifcsdef{fontsetup@sanskrit@#1}% {\csname fontsetup@sanskrit@#1\endcsname}% @@ -27,29 +38,27 @@ and may look very wrong.} \define@key{sanskrit}{script}[Devanagari]{\setkeys{sanskrit}{Script=#1}} \def\fontsetup@sanskrit@Devanagari{% - \SetLanguageKeys{sanskrit}{scripttag=deva,script=Devanagari} + \SetLanguageKeys{sanskrit}{scripttag=deva,script=Devanagari,bcp47=sa-Deva} \xpg@fontsetup@nonlatin{sanskrit}} \def\fontsetup@sanskrit@Gujarati{% - \SetLanguageKeys{sanskrit}{scripttag=gujr,script=Gujarati} + \SetLanguageKeys{sanskrit}{scripttag=gujr,script=Gujarati,bcp47=sa-Gujr} \xpg@fontsetup@nonlatin{sanskrit}} \def\fontsetup@sanskrit@Malayalam{% - \SetLanguageKeys{sanskrit}{scripttag=mlym,script=Malayalam} + \SetLanguageKeys{sanskrit}{scripttag=mlym,script=Malayalam,bcp47=sa-Mlym} \xpg@fontsetup@nonlatin{sanskrit}} \def\fontsetup@sanskrit@Bengali{% - \SetLanguageKeys{sanskrit}{scripttag=beng,script=Bengali} + \SetLanguageKeys{sanskrit}{scripttag=beng,script=Bengali,bcp47=sa-Beng} \xpg@fontsetup@nonlatin{sanskrit}} \def\fontsetup@sanskrit@Kannada{% - \SetLanguageKeys{sanskrit}{scripttag=knda,script=Kannada} + \SetLanguageKeys{sanskrit}{scripttag=knda,script=Kannada,bcp47=sa-Knda} \xpg@fontsetup@nonlatin{sanskrit}} \def\fontsetup@sanskrit@Telugu{% - \SetLanguageKeys{sanskrit}{scripttag=telu,script=Telugu} + \SetLanguageKeys{sanskrit}{scripttag=telu,script=Telugu,bcp47=sa-Relu} \xpg@fontsetup@nonlatin{sanskrit}} \def\fontsetup@sanskrit@Latin{% - \SetLanguageKeys{sanskrit}{scripttag=latn,script=Latin} + \SetLanguageKeys{sanskrit}{scripttag=latn,script=Latin,bcp47=sa-Latn} \xpg@fontsetup@latin{sanskrit}} -\setkeys{sanskrit}{Script} %sets the default for Devanagari - \newif\ifsanskrit@devanagari@numerals \sanskrit@devanagari@numeralstrue @@ -65,6 +74,10 @@ and may look very wrong.} }{\xpg@warning{Unknown Sanskrit numeral `#1'}} +% Register default options +\xpg@initialize@gloss@options{sanskrit}{script=Devanagari,numerals=Devanagari} + + \newcommand{\sanskritnumerals}[2]{\sanskritnumber{#2}} \def\sanskritnumber#1{% @@ -78,7 +91,8 @@ and may look very wrong.} \ifluatex \directlua{require('polyglossia-sanskrit')}% \else - \newXeTeXintercharclass\sanskrit@punctthin % ! ? ‼ ⁇ ⁈ ⁉ : ; danda double_danda + \newXeTeXintercharclass\sanskrit@questionexclamation % ! ? ‼ ⁇ ⁈ ⁉ ‽ + \newXeTeXintercharclass\sanskrit@punctthin % : ; danda double_danda \fi \def\sanskrit@punctthinspace{{\unskip\thinspace}} @@ -88,17 +102,20 @@ and may look very wrong.} \directlua{polyglossia.activate_sanskrit_punct()}% \else \XeTeXinterchartokenstate=1% - \XeTeXcharclass `\! \sanskrit@punctthin - \XeTeXcharclass `\? \sanskrit@punctthin - \XeTeXcharclass `\‼ \sanskrit@punctthin - \XeTeXcharclass `\⁇ \sanskrit@punctthin - \XeTeXcharclass `\⁈ \sanskrit@punctthin - \XeTeXcharclass `\⁉ \sanskrit@punctthin + \XeTeXcharclass `\! \sanskrit@questionexclamation + \XeTeXcharclass `\? \sanskrit@questionexclamation + \XeTeXcharclass `\‼ \sanskrit@questionexclamation + \XeTeXcharclass `\⁇ \sanskrit@questionexclamation + \XeTeXcharclass `\⁈ \sanskrit@questionexclamation + \XeTeXcharclass `\⁉ \sanskrit@questionexclamation + \XeTeXcharclass `\‽ \sanskrit@questionexclamation % interrobang, U+203D \XeTeXcharclass `\: \sanskrit@punctthin \XeTeXcharclass `\; \sanskrit@punctthin \XeTeXcharclass `\। \sanskrit@punctthin % danda, U+0964 \XeTeXcharclass `\॥ \sanskrit@punctthin % double danda, U+0965 + \XeTeXinterchartoks \z@ \sanskrit@questionexclamation = \sanskrit@punctthinspace \XeTeXinterchartoks \z@ \sanskrit@punctthin = \sanskrit@punctthinspace + \XeTeXinterchartoks \sanskrit@questionexclamation \sanskrit@punctthin = \sanskrit@punctthinspace \fi } @@ -112,6 +129,7 @@ and may look very wrong.} \XeTeXcharclass `\⁇ \z@ \XeTeXcharclass `\⁈ \z@ \XeTeXcharclass `\⁉ \z@ + \XeTeXcharclass `\‽ \z@ \XeTeXcharclass `\: \z@ \XeTeXcharclass `\; \z@ \XeTeXcharclass `\। \z@ |