summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/arabi/arabnovowel.sty
blob: 3a4ab16b867264132f0daebf21fb3f59f86199b6 (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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
% \iffalse meta-comment
%
% Copyright 2006      Youssef Jabri
% 
% 
% This file is part of the `Arabi' system.
% -------------------------------------------
% 
% It may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3b
% of this license or (at your option) any later version.
% The latest version of this license is in
%    http://www.latex-project.org/lppl.txt
% and version 1.3b or later is part of all distributions of LaTeX 
% version 2005/12/01 or later.
% 
% This file has the LPPL maintenance status "maintained".
% 
% 
% \fi
%
% Filename: `arabnovowel.sty' To vocalize and deVocalize Arabic/Farsi text 
% 
%
%%%%%%%%%%%%%%%%%%%%%%%% Font Names %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Check if file is loaded and announce file on terminal:
%
\csname ArabnovowelLoaded\endcsname
\let\ArabnovowelLoaded\endinput


\ProvidesFile{arabnovowel.sty}    
        [2005/09/07 v0.1 Arabic dummy vowel slots when needed]


% A Flag to dectect later on if we are vocalizing or not
\newif\ifVocalize
%
% Declaring vowels off
%
\DeclareTextCommand{\fathaOFF}{LAE}{}
\DeclareTextCommand{\dammaOFF}{LAE}{}
\DeclareTextCommand{\kasraOFF}{LAE}{}
\DeclareTextCommand{\sukunOFF}{LAE}{}
\DeclareTextCommand{\shaddaOFF}{LAE}{}
%
\DeclareTextCommand{\raffOFF}{LAE}{}
\DeclareTextCommand{\nasbOFF}{LAE}{}
\DeclareTextCommand{\jarrOFF}{LAE}{}
%
\DeclareTextCommand{\shaddanasbOFF}{LAE}{}
\DeclareTextCommand{\shaddaraffOFF}{LAE}{}
\DeclareTextCommand{\shaddajarrOFF}{LAE}{}
%
\DeclareTextCommand{\shaddafathaOFF}{LAE}{}
\DeclareTextCommand{\shaddadammaOFF}{LAE}{}
\DeclareTextCommand{\shaddakasraOFF}{LAE}{}
%
% Declaring Saved vowels for posterior use
%
\DeclareTextSymbol{\nasbSAV}{LAE}{190}
\DeclareTextSymbol{\raffSAV}{LAE}{191}
\DeclareTextSymbol{\jarrSAV}{LAE}{192}
%
\DeclareTextSymbol{\shaddanasbSAV}{LAE}{198}
\DeclareTextSymbol{\shaddaraffSAV}{LAE}{199}
\DeclareTextSymbol{\shaddajarrSAV}{LAE}{200}
%
% Then, Vowels that come anywhere in a word
%
\DeclareTextSymbol{\fathaSAV}{LAE}{97}%{161}
\DeclareTextSymbol{\dammaSAV}{LAE}{117}%{162}
\DeclareTextSymbol{\kasraSAV}{LAE}{105}%{163}
\DeclareTextSymbol{\shaddaSAV}{LAE}{204}%{164}
\DeclareTextSymbol{\sukunSAV}{LAE}{34}%{197}%{}
%
\DeclareTextSymbol{\shaddafathaSAV}{LAE}{201}%169
\DeclareTextSymbol{\shaddadammaSAV}{LAE}{202}%170
\DeclareTextSymbol{\shaddakasraSAV}{LAE}{203}%171
%
% And now for the LFE encoding used by Farsi
%
\DeclareTextCommand{\ffathaOFF}{LFE}{}
\DeclareTextCommand{\fdammaOFF}{LFE}{}
\DeclareTextCommand{\fkasraOFF}{LFE}{}
\DeclareTextCommand{\fsukunOFF}{LFE}{}
\DeclareTextCommand{\fshaddaOFF}{LFE}{}
%
\DeclareTextCommand{\fraffOFF}{LFE}{}
\DeclareTextCommand{\fnasbOFF}{LFE}{}
\DeclareTextCommand{\fjarrOFF}{LFE}{}
%
\DeclareTextCommand{\fshaddanasbOFF}{LFE}{}
\DeclareTextCommand{\fshaddaraffOFF}{LFE}{}
\DeclareTextCommand{\fshaddajarrOFF}{LFE}{}
%
\DeclareTextCommand{\fshaddafathaOFF}{LFE}{}
\DeclareTextCommand{\fshaddadammaOFF}{LFE}{}
\DeclareTextCommand{\fshaddakasraOFF}{LFE}{}
%
% Declaring Saved vowels for posterior use
%
\DeclareTextSymbol{\fnasbSAV}{LFE}{190}
\DeclareTextSymbol{\fraffSAV}{LFE}{191}
\DeclareTextSymbol{\fjarrSAV}{LFE}{192}
%
\DeclareTextSymbol{\fshaddanasbSAV}{LFE}{198}
\DeclareTextSymbol{\fshaddaraffSAV}{LFE}{199}
\DeclareTextSymbol{\fshaddajarrSAV}{LFE}{200}
%
% Then, Vowels that come anywhere in a word
%
\DeclareTextSymbol{\ffathaSAV}{LFE}{97}%{161}
\DeclareTextSymbol{\fdammaSAV}{LFE}{117}%{162}
\DeclareTextSymbol{\fkasraSAV}{LFE}{105}%{163}
\DeclareTextSymbol{\fshaddaSAV}{LFE}{204}%{164}
\DeclareTextSymbol{\fsukunSAV}{LFE}{34}%{197}%{}
%
\DeclareTextSymbol{\fshaddafathaSAV}{LFE}{201}%169
\DeclareTextSymbol{\fshaddadammaSAV}{LFE}{202}%170
\DeclareTextSymbol{\fshaddakasraSAV}{LFE}{203}%171
%
%%%%%%%%%%% An Arabi Strut that does not depend on the font
% and changes with the the same font according the fact the
% text is vocalized or not!
%
\newlength{\ArabiStruthightOFF}
\newlength{\ArabiStrutdepthOFF}
\newlength{\ArabiStruthightON}
\newlength{\ArabiStrutdepthON}
%
\settoheight{\ArabiStruthightOFF}{{\if@farsi\fontencoding{LFE}\else%
                                   \fontencoding{LAE}\fi\selectfont\alefhamza}}%
\settodepth{\ArabiStrutdepthOFF}{{\if@farsi\fontencoding{LFE}\else%
                                   \fontencoding{LAE}\fi\selectfont\Haa}}%
\settoheight{\ArabiStruthightON}{{\if@farsi\fontencoding{LFE}\else%
                                   \fontencoding{LAE}\fi\selectfont\damma}}%
\settodepth{\ArabiStrutdepthON}{{\if@farsi\fontencoding{LFE}\else%
                                   \fontencoding{LAE}\fi\selectfont\kasra}}%
%
%
\def\ArabiStrutON{\rule[\ArabiStrutdepthON]{0pt}{\ArabiStruthightON}}
\def\ArabiStrutOFF{\rule[\ArabiStrutdepthOFF]{0pt}{\ArabiStruthightOFF}}
%
%
%  Switching vowels off
%
\def\Novocalize{%
\Vocalizefalse
\renewcommand{\fatha}{\if@farsi\ffathaOFF\else\fathaOFF\fi}%
\renewcommand{\damma}{\if@farsi\fdammaOFF\else\dammaOFF\fi}%
\renewcommand{\kasra}{\if@farsi\fkasraOFF\else\kasraOFF\fi}%
\renewcommand{\sukun}{\if@farsi\fsukunOFF\else\sukunOFF\fi}%
\renewcommand{\shadda}{\if@farsi\fshaddaOFF\else\shaddaOFF\fi}%
%
\renewcommand{\raff}{\if@farsi\fraffOFF\else\raffOFF\fi}%
\renewcommand{\nasb}{\if@farsi\fnasbOFF\else\nasbOFF\fi}%
\renewcommand{\jarr}{\if@farsi\fjarrOFF\else\raffOFF\fi}%
%
\renewcommand{\shaddanasb}{\if@farsi\fshaddanasbOFF\else\shaddanasbOFF\fi}%
\renewcommand{\shaddaraff}{\if@farsi\fshaddaraffOFF\else\shaddaraffOFF\fi}%
\renewcommand{\shaddajarr}{\if@farsi\fshaddajarrOFF\else\shaddajarrOFF\fi}%
%
\renewcommand{\shaddafatha}{\if@farsi\fshaddafathaOFF\else\shaddafathaOFF\fi}%
\renewcommand{\shaddadamma}{\if@farsi\fshaddadammaOFF\else\shaddadammaOFF\fi}%
\renewcommand{\shaddakasra}{\if@farsi\fshaddakasraOFF\else\shaddakasraOFF\fi}%
}
%
% reactivating vowels
%
\def\Vocalize{%
\Vocalizetrue
\renewcommand{\fatha}{\if@farsi\ffathaSAV\else\fathaSAV\fi}%
\renewcommand{\damma}{\if@farsi\fdammaSAV\else\dammaSAV\fi}%
\renewcommand{\kasra}{\if@farsi\fkasraSAV\else\kasraSAV\fi}%
\renewcommand{\sukun}{\if@farsi\fsukunSAV\else\sukunSAV\fi}%
\renewcommand{\shadda}{\if@farsi\fshaddaSAV\else\shaddaSAV\fi}%
%
\renewcommand{\raff}{\if@farsi\fraffSAV\else\raffSAV\fi}%
\renewcommand{\nasb}{\if@farsi\fnasbSAV\else\nasbSAV\fi}%
\renewcommand{\jarr}{\if@farsi\fjarrSAV\else\raffSAV\fi}%
%
\renewcommand{\shaddanasb}{\if@farsi\fshaddanasbSAV\else\shaddanasbSAV\fi}%
\renewcommand{\shaddaraff}{\if@farsi\fshaddaraffSAV\else\shaddaraffSAV\fi}%
\renewcommand{\shaddajarr}{\if@farsi\fshaddajarrSAV\else\shaddajarrSAV\fi}%
%
\renewcommand{\shaddafatha}{\if@farsi\fshaddafathaSAV\else\shaddafathaSAV\fi}%
\renewcommand{\shaddadamma}{\if@farsi\fshaddadammaSAV\else\shaddadammaSAV\fi}%
\renewcommand{\shaddakasra}{\if@farsi\fshaddakasraSAV\else\shaddakasraSAV\fi}%
}
%
% The default value of \cs{Voclaizetrue} and \cs{vocalize}
%
\Vocalizetrue
\Vocalize


\def\ArabiStrut{\ifVocalize\ArabiStrutON\else\ArabiStrutOFF\fi}



\endinput