blob: d548d8a5570564bbbea52b6e09b66b11d49a37df (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
\ProvidesFile{gloss-sanskrit.ldf}[polyglossia: module for sanskrit]
\makeatletter
\ifx\l@sanskrit\@undefined%
\ifx\l@prakrit\@undefined%
\xpg@nopatterns{Sanskrit}%
\adddialect\l@sanskrit\l@nohyphenation%
\else%
\let\l@sanskrit=\l@prakrit%
\fi%
\fi
\def\tmp@deva{Devanagari}
\define@key{sanskrit}{Script}[Devanagari]{%
\gdef\sanskrit@script{#1}}
\setkeys{sanskrit}{Script}
\newXeTeXintercharclass\sanskrit@punctthin % ! ? ; : danda double_danda
\def\sanskrit@punctthinspace{{\unskip\thinspace}}
\def\sanskrit@punctuation{%
\frenchspacing%
\XeTeXinterchartokenstate=1%
\XeTeXcharclass `\! \sanskrit@punctthin
\XeTeXcharclass `\? \sanskrit@punctthin
\XeTeXcharclass `\; \sanskrit@punctthin
\XeTeXcharclass `\: \sanskrit@punctthin
\XeTeXcharclass `\। \sanskrit@punctthin
\XeTeXcharclass `\॥ \sanskrit@punctthin
\XeTeXinterchartoks \z@ \sanskrit@punctthin = \sanskrit@punctthinspace
}
\def\nosanskrit@punctuation{%
\nonfrenchspacing%
\XeTeXinterchartokenstate=0%
}
%\def\captionssanskrit{%
% \def\refname{<++>}%
% \def\abstractname{<++>}%
% \def\bibname{<++>}%
% \def\prefacename{<++>}%
% \def\chaptername{<++>}%
% \def\appendixname{<++>}%
% \def\contentsname{<++>}%
% \def\listfigurename{<++>}%
% \def\listtablename{<++>}%
% \def\indexname{<++>}%
% \def\figurename{<++>}%
% \def\tablename{<++>}%
% \def\thepart{}%
% \def\partname{<++>}%
% \def\pagename{<++>}%
% \def\seename{<++>}%
% \def\alsoname{<++>}%
% \def\enclname{<++>}%
% \def\ccname{<++>}%
% \def\headtoname{<++>}%
% \def\proofname{<++>}%
% \def\glossaryname{<++>}%
% \def\today{<++>}}
\def\sanskrit@font{%
\@ifundefined{sanskritfont}{%
\@ifundefined{devanagarifont}{%
\font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt
\zf@check@ot@script{deva}%
\ifx\sanskrit@script\tmp@deva%
\if@tempswa%
\addfontfeature{Script=Devanagari}%
\else%
\PackageError{polyglossia}{^^J
The current font does not contain the devanagari script!^^J
Please define \string\devanagarifont\space or \string\sanskritfont\space with \string\newfontfamily}%
\fi%
\else%
\addfontfeature{Script=\sanskrit@script}%
\fi%
\zf@check@ot@lang{SAN}%
\if@tempswa\addfontfeature{Language=Sanskrit}\fi%
}%
{\devanagarifont%
\zf@check@ot@lang{SAN}%
\if@tempswa\addfontfeature{Language=Sanskrit}\fi%
}%
}%
{\sanskritfont}%
}
\def\selectnormalfontsanskrit{%
\let\normalfont=\sanskrit@font%
\let\rmfamily=\sanskrit@font%
% TODO add setup to define Sans and Mono Sanskrit fonts if desired
\let\sffamily=\sanskrit@font%
\let\ttfamily=\sanskrit@font%
\def\reset@font{\normalfont}}
\def\sanskrit@language{\language=\l@sanskrit}
\setlocalhyphenmins{sanskrit}{1}{3}%
\def\noextras@sanskrit{%
\nosanskrit@punctuation%
}
\def\blockextras@sanskrit{%
\sanskrit@punctuation%
}
\endinput
|