%D \module
%D   [     file=enco-ec,
%D      version=1999.16.7,
%D        title=\CONTEXT\ Encoding Macros,
%D     subtitle=\LaTeX\ EC Encoding,
%D       author=Taco Hoekwater,
%D         date=\currentdate,
%D    copyright=H. Hagen]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See licen-en.pdf for 
%C details. 

%D This is \LaTeX2e's T1 encoding vector, which 
%D seems to be popular with certain people. All standard
%D \LaTeX\ accents will work, including \type{\k}. The only accent
%D that does not work is \type{\t} (there is no tie in T1 encoding).
%D 
%D Annoyingly, most PostScript fonts do not have \type{\dotlessj}, 
%D and T1 encoding does not make the various prebuilts with
%D \type{j} available.
%D
%D There is hardly a point in supporting TS1 encoding. 

\startmapping[ec] 

%D the case mappings are fairly simple. Perhaps there is a shortcut
%D to do this?

\definecasemap 128 160 128
\definecasemap 129 161 129
\definecasemap 130 162 130
\definecasemap 131 163 131
\definecasemap 132 164 132
\definecasemap 133 165 133
\definecasemap 134 166 134
\definecasemap 135 167 135
\definecasemap 136 168 136
\definecasemap 137 169 137
\definecasemap 138 170 138
\definecasemap 139 171 139
\definecasemap 140 172 140
\definecasemap 141 173 141
\definecasemap 142 174 142
\definecasemap 143 175 143
\definecasemap 144 176 144
\definecasemap 145 177 145
\definecasemap 146 178 146
\definecasemap 147 179 147
\definecasemap 148 180 148
\definecasemap 149 181 149
\definecasemap 150 182 150
\definecasemap 151 183 151
\definecasemap 152 184 152
\definecasemap 153 185 153
\definecasemap 154 186 154
\definecasemap 155 187 155
\definecasemap 156 188 156

%D 157 Idotaccent
%D 158 dcroat (with bar)
%D 159 sectionmark

\definecasemap 160 128 160 
\definecasemap 161 129 161 
\definecasemap 162 130 162 
\definecasemap 163 131 163 
\definecasemap 164 132 164 
\definecasemap 165 133 165 
\definecasemap 166 134 166 
\definecasemap 167 135 167 
\definecasemap 168 136 168 
\definecasemap 169 137 169 
\definecasemap 170 138 170 
\definecasemap 171 139 171 
\definecasemap 172 140 172 
\definecasemap 173 141 173 
\definecasemap 174 142 174 
\definecasemap 175 143 175 
\definecasemap 176 144 176 
\definecasemap 177 145 177 
\definecasemap 178 146 178 
\definecasemap 179 147 179 
\definecasemap 180 148 180 
\definecasemap 181 149 181 
\definecasemap 182 150 182 
\definecasemap 183 151 183 
\definecasemap 184 152 184 
\definecasemap 185 153 185 
\definecasemap 186 154 186 
\definecasemap 187 155 187 
\definecasemap 188 156 188

%D 189 exclamdown
%D 190 questiondown
%D 191 sterling pound

\definecasemap 192 224 192
\definecasemap 193 225 193
\definecasemap 194 226 194
\definecasemap 195 227 195
\definecasemap 196 228 196  
\definecasemap 197 229 197
\definecasemap 198 230 198
\definecasemap 199 231 199
\definecasemap 200 232 200
\definecasemap 201 233 201
\definecasemap 202 234 202
\definecasemap 203 235 203
\definecasemap 204 236 204
\definecasemap 205 237 205
\definecasemap 206 238 206
\definecasemap 207 239 207
\definecasemap 208 240 208
\definecasemap 209 241 209
\definecasemap 210 242 210
\definecasemap 211 243 211
\definecasemap 212 244 212
\definecasemap 213 245 213
\definecasemap 214 246 214
\definecasemap 215 247 215
\definecasemap 216 248 216
\definecasemap 217 249 217
\definecasemap 218 250 218
\definecasemap 219 251 219
\definecasemap 220 252 220
\definecasemap 221 253 221
\definecasemap 222 254 222
\definecasemap 223 255 223
\definecasemap 224 224 192 
\definecasemap 225 225 193 
\definecasemap 226 226 194 
\definecasemap 227 227 195 
\definecasemap 228 228 196
\definecasemap 229 229 197
\definecasemap 230 230 198
\definecasemap 231 231 199
\definecasemap 232 232 200 
\definecasemap 233 233 201 
\definecasemap 234 234 202 
\definecasemap 235 235 203 
\definecasemap 236 236 204 
\definecasemap 237 237 205 
\definecasemap 238 238 206 
\definecasemap 239 239 207
\definecasemap 240 240 208 
\definecasemap 241 241 209 
\definecasemap 242 242 210 
\definecasemap 243 243 211 
\definecasemap 244 244 212 
\definecasemap 245 245 213 
\definecasemap 246 246 214
\definecasemap 247 247 215
\definecasemap 248 248 216 
\definecasemap 249 249 217 
\definecasemap 250 250 218 
\definecasemap 251 251 219 
\definecasemap 252 252 220 
\definecasemap 253 253 221
\definecasemap 254 254 222 
\definecasemap 255 255 223 

\stopmapping

\startencoding[ec]

\defineaccent u A 128
\defineaccent v C 131
\defineaccent v D 132
\defineaccent v E 133
\defineaccent u G 135
\defineaccent v l 137 % Lcaron
\defineaccent v N 140
\defineaccent H O 142
\defineaccent v R 144
\defineaccent v S 146
\defineaccent v T 148
\defineaccent H U 150
\defineaccent r U 151
\defineaccent v Z 154
\defineaccent . Z 155
\defineaccent . I 157
\defineaccent = d 158

\defineaccent u a 160
\defineaccent v c 163
\defineaccent v d 164
\defineaccent v e 165
\defineaccent u g 167
\defineaccent v l 169
\defineaccent v n 172
\defineaccent H o 174
\defineaccent v r 176
\defineaccent v s 178
\defineaccent v t 180
\defineaccent H u 182
\defineaccent r u 183
\defineaccent v z 186
\defineaccent . z 187

\defineaccent ' C 130
\defineaccent ' L 136
\defineaccent ' N 139
\defineaccent ' R 143
\defineaccent ' S 145
\defineaccent " Y 152
\defineaccent ' Z 153
\defineaccent ' c 162
\defineaccent ' l 168
\defineaccent ' n 171
\defineaccent ' r 175
\defineaccent ' s 177
\defineaccent " y 184
\defineaccent ' z 185
\defineaccent ` A 192
\defineaccent ' A 193
\defineaccent ^ A 194
\defineaccent ~ A 195
\defineaccent " A 196      
\defineaccent r A 197
\defineaccent ` E 200
\defineaccent ' E 201
\defineaccent ^ E 202
\defineaccent " E 203
\defineaccent ` I 204
\defineaccent ' I 205
\defineaccent ^ I 206
\defineaccent " I 207
\defineaccent ~ N 209
\defineaccent ` O 210
\defineaccent ' O 211
\defineaccent ^ O 212
\defineaccent ~ O 213
\defineaccent " O 214
\defineaccent ` U 217
\defineaccent ' U 218
\defineaccent ^ U 219
\defineaccent " U 220
\defineaccent ' Y 221
\defineaccent ` a 224
\defineaccent ' a 225
\defineaccent ^ a 226
\defineaccent ~ a 227
\defineaccent " a 228      
\defineaccent r a 229
\defineaccent ` e 232
\defineaccent ' e 233
\defineaccent ^ e 234
\defineaccent " e 235      
\defineaccent ` i 236
\defineaccent ' i 237
\defineaccent ^ i 238
\defineaccent " i 239
\defineaccent ~ n 241
\defineaccent ` o 242
\defineaccent ' o 243
\defineaccent ^ o 244
\defineaccent ~ o 245
\defineaccent " o 246
\defineaccent ` u 249
\defineaccent ' u 250
\defineaccent ^ u 251
\defineaccent " u 252
\defineaccent ' y 253

\defineaccent ` {\dotlessi} 236
\defineaccent ' {\dotlessi} 237
\defineaccent " {\dotlessi} 239
\defineaccent ^ {\dotlessi} 238

\defineaccent ` {\i} 236
\defineaccent ' {\i} 237
\defineaccent " {\i} 239
\defineaccent ^ {\i} 238

%
%D These are special, see below.
%
\defineaccent k A 129
\defineaccent k E 134
\defineaccent k a 161
\defineaccent k e 166
\defineaccent c T 149
\defineaccent c S 147
\defineaccent c C 199
\defineaccent c c 231
\defineaccent c s 179
\defineaccent c t 181

\definecharacter ae 230
\definecharacter oe 247
\definecharacter o  248
\definecharacter AE 198
\definecharacter OE 215
\definecharacter O  216
\definecharacter ss 255
\definecharacter SS 223

\definecharacter th 254
\definecharacter TH 222

\definecharacter ng 173
\definecharacter NG 141

\definecharacter ij 188
\definecharacter IJ 156

%D next four are strictly unneeded
\definecharacter aa 229
\definecharacter AA 197
\definecharacter cc 231
\definecharacter CC 199

\definecharacter l 170
\definecharacter L 138

\definecharacter i 25
% \definecharacter j 26


%D this next line is strange, but needed.
\redefineaccent =

\defineaccentcommand ` 0
\defineaccentcommand ' 1
\defineaccentcommand ^ 2
\defineaccentcommand ~ 3
\defineaccentcommand " 4
\defineaccentcommand H 5
\defineaccentcommand r 6
\defineaccentcommand v 7
\defineaccentcommand u 8
\defineaccentcommand = 9
\defineaccentcommand . 10

%D ogonek does not normally exist in context

\redefineaccent k

%D The rather weird construction that follows is needed because 
%D otherwise (using \type{\definecommand}) the pre-built chars are
%D never used. Same trick could be used in the \type{enco-ans}
%D file, such that the macro for ccedille can be removed.

%D initialization needed to get past defineaccentcommand
\def\ecencodedb{}
\def\ecencodedc{}
\def\ecencodedk{}

\defineaccentcommand b {\ecencodedb}
\defineaccentcommand c {\ecencodedc}
\defineaccentcommand k {\ecencodedk}


\def\ecencodedb#1%
  {\oalign{#1\crcr\hidewidth\vbox to.2ex{\hbox{\char9}\vss}\hidewidth}}

\def\ecencodedc#1%
  {\setbox0\hbox{#1}\ifdim\ht0=1ex\accent11 #1\else
     {\ooalign{\hidewidth\char11\hidewidth\crcr\unhbox0}}\fi}

\def\ecencodedk#1%
  {\setbox0\hbox{#1}\ifdim\ht0=1ex\accent12 #1\else
     {\ooalign{\hidewidth\char12\hidewidth\crcr\unhbox0}}\fi}

\stopencoding

\endinput
