-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVEP2Unicode.jsx
734 lines (660 loc) · 76.4 KB
/
VEP2Unicode.jsx
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
// The VPE2EWTS script
// copyright 2010-2013 © Elie Roux <[email protected]>
//
// VPE2EWTS is under the Creative Commons CC0 license, which is as close to
// public domain as possible in the country of the authors.
// See the full text [1] or the FAQ [2].
//
// [1]: http://creativecommons.org/publicdomain/zero/1.0/legalcode
// [2]: http://wiki.creativecommons.org/CC0
//
// This script is for Indesign but can be easily adapted to any other
// language or software. The meaning of the name is Vieil Encodage Pourri to
// Extended Wylie Transcription Scheme. Vieil encodage pourri means Old rotten
// encoding in french.
#strict on
#target indesign
// Here is a serie of options for the script:
// set it to 1 if you want to translate Tibetan Machine Web also (not the default because of the
// use we have here, but 1 is quite a reasonable default.
var ConvertTibetanMachineWeb = 1;
// set the font you want to use for Unicode:
var UniTibetanFont = "REPLACE THIS BY THE FONT YOU WANT TO USE";
var UniTibetanFontSize = 0;
// WRC shouldn't be used (too buggy with Tibetan...)
var ConvertToWRC = 0;
// An important config table, for automatic formatting:
// keys are the font sizes, and values are either:
// - the font size at which we want to convert them (if the value is numeric)
// - the character style which they'll get (if not numeric).
// In the values given as examples, if the script encounters characters with size 13, it will
// convert them to characters in size 32, and if it encounters size 14, it will convert to style
// 'foo', creating it if it doesn't exist.
var FontSizeCor = {
13: 32,
14: 'foo',
};
// A mechanism to allow or not previous behaviour:
var ComplexFontSizeCor = 0;
// For CS3 and CS4, InDesign gives sometimes numbers, their meaning is here:
// http://www.cooldtp.cn/InDesign/CS3-JavaScript-help/pg_SpecialCharacters.html
// the following code is a duplicate of this table, with first the CS3/4 number
// then the CS5/6 (and more I hope...) unicode name, this is used when a character
// is not found in the character tables
var CS3Charcor = {
//"1400073805":"SECTION_MARKER",
"1396862068":"•",
"1396929140":"©",
"1396991858":"°",
"1397518451":"…",
"1397776754":"¶",
"1397904493":"®",
"1400073811":"§",
"1398041963":"™",
"1397058884":"—",
"1397059140":"–",
"1396983920":"XXX", // see comment on DISCRETIONARY_HYPHEN
"1397645928":"NONBREAKING_HYPHEN",
"1396984945":"“",
"1396986481":"”",
"1397967985":"‘",
"1397969521":"’",
"1397645907":"NONBREAKING_SPACE",
"1397969777":"'",
"1396986737":'"',
"'":"'",
""":'"',
};
var UniNameCharcor = {
//"SECTION_MARKER":"",
"BULLET_CHARACTER":"•",
"COPYRIGHT_SYMBOL":"©",
"DEGREE_SYMBOL":"°",
"ELLIPSIS_CHARACTER":"…",
"PARAGRAPH_SYMBOL":"¶",
"REGISTERED_TRADEMARK":"",
"SECTION_SYMBOL":"§",
"REGISTERED_TRADEMARK":"®",
"TRADEMARK_SYMBOL":"™",
"EM_DASH":"—",
"EN_DASH":"–",
// DISCRETIONARY_HYPHEN is a very special case: there is a glyph coded for
// this character in the font, and the glyph appears in the glyph
// list of InDesign, but if you click on it, it won't appear (as this code is
// not displayed), so sometimes, when you have this code this means that the user
// tried to select the glyph, but it didn't work, so it should be replaced by
// nothing, hence the special code...
"DISCRETIONARY_HYPHEN":"XXX",
//"NONBREAKING_HYPHEN":"",
"DOUBLE_LEFT_QUOTE":"“",
"DOUBLE_RIGHT_QUOTE":"”",
"SINGLE_LEFT_QUOTE":"‘",
"SINGLE_RIGHT_QUOTE":"’",
"NONBREAKING_SPACE":" ",
"SINGLE_STRAIGHT_QUOTE":"'",
"DOUBLE_STRAIGHT_QUOTE":'"',
"LEFT_DOUBLE_QUOTATION_MARK":"“",
};
// These two tables are an index of character (not glyph) encoding, to have other tables written simply.
// The first is for the fonts Ededris, Dedris and TibetanMachineWeb
var ededrisCharcor = {' ':0, '!':1, '#':2, '$':3, '%': 4, '&':5, '\'':6, '(':7, ')':8, '*':9,
'+':10, ',':11, '-': 12, '.':13, '/':14, '0':15, '1':16, '2':17, '3':18, '4':19,
'5':20, '6':21, '7':22, '8':23, '9':24, ':':25, ';':26, '<':27, '=':28, '>':29,
'?':30, '@':31, 'A':32, 'B':33, 'C':34, 'D':35, 'E':36, 'F':37, 'G':38, 'H':39,
'I':40, 'J':41, 'K':42, 'L':43, 'M':44, 'N':45, 'O':46, 'P':47, 'Q':48, 'R':49,
'S':50, 'T':51, 'U':52, 'V':53, 'W':54, 'X':55, 'Y':56, 'Z':57, '[':58, '\\':59,
']':60, '^':61, '_':62, 'a':63, 'b':64, 'c':65, 'd':66, 'e':67, 'f':68, 'g':69,
'h':70, 'i':71, 'j':72, 'k':73, 'l':74, 'm':75, 'n':76, 'o':77, 'p':78, 'q':79,
'r':80, 's':81, 't':82, 'u':83, 'v':84, 'w':85, 'x':86, 'y':87, 'z':88, '{':89,
'|':90, '}':91, '~':92, '"':93, '`':94, '':95, '':96, ' ':97, '-':98, };
var tibmachineCharcor = {' ':0, '!':1, '"':2, '#':3, '$':4, '%': 5, '&':6, '\'':7, '(':8, ')':9,
'*':10, '+':11, ',':12, '-': 13, '.':14, '/':15, '0':16, '1':17, '2':18, '3':19,
'4':20, '5':21, '6':22, '7':23, '8':24, '9':25, ':':26, ';':27, '<':28, '=':29,
'>':30, '?':31, '@':32, 'A':33, 'B':34, 'C':35, 'D':36, 'E':37, 'F':38, 'G':39,
'H':40, 'I':41, 'J':42, 'K':43, 'L':44, 'M':45, 'N':46, 'O':47, 'P':48, 'Q':49,
'R':50, 'S':51, 'T':52, 'U':53, 'V':54, 'W':55, 'X':56, 'Y':57, 'Z':58, '[':59,
'\\':60, ']':61, '^':62, '_':63, 'a':64, 'b':65, 'c':66, 'd':67, 'e':68, 'f':69,
'g':70, 'h':71, 'i':72, 'j':73, 'k':74, 'l':75, 'm':76, 'n':77, 'o':78, 'p':79,
'q':80, 'r':81, 's':82, 't':83, 'u':84, 'v':85, 'w':86, 'x':87, 'y':88, 'z':89,
'{':90, '|':91, '}':92, '~':93, '"':94, '`':95, '':96, '':97, ' ':98, '-':99};
var ChosgyalCharcor = {' ':0, '!':1, '"':2, '#':3, '$':4, '%': 5, '&':6, '\'':7, '(':8, ')':9, '*':10, '+':11, ',':12, '-': 13, '.':14, '/':15, '0':16, '1':17, '2':18, '3':19, '4':20, '5':21, '6':22, '7':23, '8':24, '9':25, ':':26, ';':27, ';': 27, '<':28, '=':29, '>':30, '?':31, '@':32, 'A':33, 'B':34, 'C':35, 'D':36, 'E':37, 'F':38, 'G':39, 'H':40, 'I':41, 'J':42, 'K':43, 'L':44, 'M':45, 'N':46, 'O':47, 'P':48, 'Q':49, 'R':50, 'S':51, 'T':52, 'U':53, 'V':54, 'W':55, 'X':56, 'Y':57, 'Z':58, '[':59, '\\':60, ']':61, '^':62, '_':63, '`':64, 'a':65, 'b':66, 'c':67, 'd':68, 'e':69, 'f':70, 'g':71, 'h':72, 'i':73, 'j':74, 'k':75, 'l':76, 'm':77, 'n':78, 'o':79, 'p':80, 'q':81, 'r':82, 's':83, 't':84, 'u':85, 'v':86, 'w':87, 'x':88, 'y':89, 'z':90, '{':91, '|':92, '}':93, '~':94, '':95, '':96, '':97, '':98, '':99,
'¡':101,
'¢':102, '£':103,
'¤':104, '¥': 105, '§':106, '¨':107, '©':108, 'ª':109, '«':110, '¬':111, "\u00AD":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,
'˜':201,
'–':204, '—':205, '‘':206, '’':207, '‚':208, '“':209, '”':210, '„':211, '†':212, '‡':213,
'•':214,
'…':215, '‰':216, '‹':217, '›':218, '€':219, '™':220,
'ð':193, // this is ok for Chosgyal, Classic is 177
'\uE004':225,
// These are strange mappings from Tibetan Classic, seems more like bugs than mappings, but that's just how it is...
'':219,
//'':203,
'':208, '':198, '':211,
'
':215, '':212, '':213, '':199, '':216, '':195, '':218, '':193,
//'':224, '':225, '':226,
'':206, '':207, '':209, '':210, '':214, '':204, '':205, '':201, '':220,
'':196, '':218, '':194,
//'':227,
'':197,
// Some other buggy things (ID specific it seems)...
'₫':95, '₪':96, '₮':97, '₯':98, '₰':99,
//"DISCRETIONARY_HYPHEN":112, "1396983920":112
};
// Classic char correspondance is the same with the exception of ð being 177 instead of 193...
var ClassicCharcor = {};
for (var key in ChosgyalCharcor) {
ClassicCharcor[key] = ChosgyalCharcor[key];
}
ClassicCharcor['ð'] = 177;
var esemaCharcor = {' ':0, '!':1, '#':2, '$':3, '%': 4, '&':5, '\'':6, '(':7, ')':8, '*':9, '+':10, ',':11, '-': 12, '.':13, '/':14, '0':15, '1':16, '2':17, '3':18, '4':19, '5':20, '6':21, '7':22, '8':23, '9':24, ':':25, ';':26, '<':27, '=':28, '>':29, '?':30, '@':31, 'A':32, 'B':33, 'C':34, 'D':35, 'E':36, 'F':37, 'G':38, 'H':39, 'I':40, 'J':41, 'K':42, 'L':43, 'M':44, 'N':45, 'O':46, 'P':47, 'Q':48, 'R':49, 'S':50, 'T':51, 'U':52, 'V':53, 'W':54, 'X':55, 'Y':56, 'Z':57, '[':58, '\\':59, ']':60, '^':61, '_':62, 'a':63, 'b':64, 'c':65, 'd':66, 'e':67, 'f':68, 'g':69, 'h':70, 'i':71, 'j':72, 'k':73, 'l':74, 'm':75, 'n':76, 'o':77, 'p':78, 'q':79, 'r':80, 's':81, 't':82, 'u':83, 'v':84, 'w':85, 'x':86, 'y':87, 'z':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, 'ß':176, '®':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, 'fi':189, 'fl':190, '‡':191, '·':192, '‚':193, '„':194, '‰':195, 'Â':196, 'Ê':197, 'Á':198, 'Ë':199, 'È':200, 'Í':201, 'Î':202, 'Ï':203, 'Ì':204, 'Ó':205, 'Ô':206, '':207, 'Ò':208, 'Ú':209, 'Û':210, 'Ù':211, 'ı':212, 'ˆ':213, '˜':214, '¯':215, '˘':216, '˙':217, '˚':218, '¸':219, '˝':220, '˛':221, 'ˇ':222, 'Þ': 176, "":141, "":82, "":91, "":41, "":190, "":13, "":88, "Ω":156, "ð":223, "∙":224, "‡":225, '¤':226,};
//
// here the last number correspond to some strange numbers that InDesign shows instead of Special Characters.
// also, don't ask me why the last value is 131, I have no idea, I assigned it after some tests.
// here start the tables. The meaning is the following one, with the example of esama:
// esama['a'][x] is the wylie transliteration of the character x=esamaCharcor[y] in the font Esama
// meaning of the second value :
// - 0: consonant
// - 1: vowel
// - 2: other
// - 3: consonant + vowel
// - 4: nothing
var esama = new Array();
esama['a'] = [[" ", 2], ["བྷྱ", 0], ["༁ྃ", 3], ["", 2], ["ྃ", 1], ["ྃ", 1], ["ཾ", 1], ["ཾ", 1], ["འུྃ", 3], ["ཏྣ", 0],
["ངྨ", 0], ["།", 2], ["་", 2], ["༑", 2], ["༴", 2], ["༠", 2], ["༡", 2], ["༢", 2], ["༣", 2], ["༤", 2],
["༥", 2], ["༦", 2], ["༧", 2], ["༨", 2], ["༩", 2], ["ཿ", 2], ["༔", 2], ["ༀ", 3], ["ཨཱཿ", 3], ["ཧཱུྃ", 3],
["༈", 0], ["ཀ", 0], ["ཀ", 0], ["ཁ", 0], ["ག", 0], ["ག", 0], ["ང", 0], ["ཅ", 0], ["ཆ", 0], ["ཇ", 0],
["ཉ", 0], ["ཉ", 0], ["ཏ", 0], ["ཏ", 0], ["ཐ", 0], ["ད", 0], ["ད", 0], ["ན", 0], ["ན", 0], ["པ", 0],
["ཕ", 0], ["བ", 0], ["མ", 0], ["ཙ", 0], ["ཚ", 0], ["ཛ", 0], ["ཝ", 0], ["ཞ", 0], ["ཞ", 0], ["ཟ", 0],
["འ", 0], ["ཡ", 0], ["ར", 0], ["ཤ", 0], ["ཤ", 0], ["ས", 0], ["ཧ", 0], ["ཨ", 0], ["ཊ", 0], ["ཊ", 0],
["ཌ", 0], ["ཌ", 0], ["ཎ", 0], ["ཎ", 0], ["ཀྱ", 0], ["ཁྱ", 0], ["གྱ", 0], ["པྱ", 0], ["ཕྱ", 0], ["བྱ", 0],
["མྱ", 0], ["ཀྲ", 0], ["ཁྲ", 0], ["གྲ", 0], ["ཏྲ", 0], ["ཐྲ", 0], ["དྲ", 0], ["པྲ", 0], ["ཕྲ", 0], ["བྲ", 0],
["མྲ", 0], ["ཤྲ", 0], ["སྲ", 0], ["༄༅", 2], ["ལ", 0], ["ཧྲ", 0], ["ཀླ", 0], ["གླ", 0], ["བླ", 0], ["ཟླ", 0],
["རླ", 0], ["སླ", 0], ["རྐ", 0], ["རྒ", 0], ["རྔ", 0], ["རྗ", 0], ["རྙ", 0], ["རྟ", 0], ["རྡ", 0], ["རྣ", 0],
["རྦ", 0], ["རྨ", 0], ["རྩ", 0], ["རྫ", 0], ["རྐྱ", 0], ["རྒྱ", 0], ["རྨྱ", 0], ["ལྐ", 0], ["ལྒ", 0], ["ལྔ", 0],
["ལྕ", 0], ["ལྗ", 0], ["ལྟ", 0], ["ལྡ", 0], ["ལྤ", 0], ["ལྦ", 0], ["ལྷ", 0], ["སྐ", 0], ["སྒ", 0], ["སྔ", 0],
["སྙ", 0], ["སྤ", 0], ["སྡ", 0], ["སྣ", 0], ["སྤ", 0], ["སྦ", 0], ["སྨ", 0], ["སྩ", 0], ["སྐྱ", 0], ["སྒྱ", 0],
["སྤྱ", 0], ["སྦྱ", 0], ["སྨྱ", 0], ["སྐྲ", 0], ["སྒྲ", 0], ["སྣྲ", 0], ["སྤྲ", 0], ["སྦྲ", 0], ["སྨྲ", 0], ["ཀྭ", 0],
["ཁྭ", 0], ["གྭ", 0], ["ཉྭ", 0], ["ཏྭ", 0], ["དྭ", 0], ["ཙྭ", 0], ["ཚྭ", 0], ["ཞྭ", 0], ["ཟྭ", 0], ["རྭ", 0],
["ལྭ", 0], ["ཤྭ", 0], ["སྭ", 0], ["ཧྭ", 0], ["གྲྭ", 0], ["དྲྭ", 0], ["རྒྭ", 0], ["རྩྭ", 0], ["ི", 1], ["ཕྱྭ", 0],
["ི", 1], ["ི", 1], ["ིཾ", 1], ["ིཾ", 1], ["ྀ", 1], ["ྀཾ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1],
["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1],
["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ེ", 1], ["ེ", 1], ["ེཾ", 1], ["ེཾ", 1], ["ཻ", 1],
["ོ", 1], ["ོ", 1], ["ོཾ", 1], ["ོཾ", 1], ["ཽ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1],
["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཋ", 0], ["ཥ", 0], ["ཥ", 0], ["ཀྵ", 0],
["ཛྲ", 0], ["རྩ", 0], ["སྐ", 0], ["ཱ", 1], ["ུ", 1], ["ུ", 1], ["སྟ", 1]];
esama['b'] = [[" ", 2], ["ཀྲ", 0], ["ཀྟ", 0], ["ཀྟྭ", 0], ["ཀྟྱ", 0], ["ཀྟྲ", 0], ["ཀྞ", 0], ["ཀྨ", 0], ["ཀྩ", 0], ["ཀྫྙ", 0],
["ཀྴ", 0], ["ཀྵ", 0], ["ཀྶ", 0], ["ཀྵྨ", 0], ["ཀྵྞ", 0], ["ཀྵྱ", 0], ["ྈྐ", 0], ["ྉྐ", 0], ["ཁྑ", 0], ["ཁྣ", 0],
["ཁླ", 0], ["ྈྑ", 0], ["ྉྑ", 0], ["གྒ", 0], ["གྡྷ", 0], ["གྣ", 0], ["གྞ", 0], ["གྦ", 0], ["གྦྱ", 0], ["གྦྷ", 0],
["གྲྱ", 0], ["གྷ", 0], ["གྷྣ", 0], ["གྷྲ", 0], ["ངྐ", 0], ["ངྑ", 0], ["ངྒ", 0], ["ངྒྷ", 0], ["ངྻ", 0], ["ངྴ", 0],
["ངྶ", 0], ["དྷ", 0], ["ཅྭ", 0], ["ཉྩ", 0], ["ཉྪ", 0], ["ཉྫ", 0], ["ཏྐ", 0], ["ཏྒ", 0], ["ཏྟ", 0], ["ཏྟྭ", 0],
["ཏྟྱ", 0], ["ཏྟྲ", 0], ["ཏྠ", 0], ["ཏྣ", 0], ["ཏྤ", 0], ["ཏྥ", 0], ["ཏྦྷ", 0], ["ཏྨ", 0], ["ཏྨྱ", 0], ["ཏྱ", 0],
["ཏྲྱ", 0], ["ཏྶ", 0], ["ཊ", 0], ["ཊྐ", 0], ["ཊྒ", 0], ["ཊྚ", 0], ["ཊྣ", 0], ["ཊྤ", 0], ["ཊྥ", 0], ["ཊྦྷ", 0],
["ཊྨ", 0], ["ཊྵ", 0], ["ཐྱ", 0], ["ཐླྷ", 0], ["ཋ", 0], ["ཋྱ", 0], ["ཋྲ", 0], ["ངྒ", 0], ["ངྒྷ", 0], ["ངྒྷྲ", 0],
["ངྔ", 0], ["ངྡྲ", 0], ["དྡྷ", 0], ["དྡྷྱ", 0], ["དྦ", 0], ["དྦྲ", 0], ["དྦྷ", 0], ["དྦྷྱ", 0], ["དྨ", 0], ["དྱ", 0],
["དྲྱ", 0], ["དྷ", 0], ["དྷྣ", 0], ["ཀྑ", 0], ["ཊ", 0], ["དྷྣྱ", 0], ["དྷྨ", 0], ["དྷྭ", 0], ["དྷྱ", 0], ["དྷྲ", 0],
["ཌ", 0], ["ཌ", 0], ["ཌྒ", 0], ["ཌྒྷ", 0], ["ཌྜ", 0], ["ཌྜྷ", 0], ["ཌྦྷ", 0], ["ཌྨ", 0], ["ཌྱ", 0], ["ཌྷ", 0],
["ཌྷྲ", 0], ["ནྟ", 0], ["ནྟྲ", 0], ["ནྠ", 0], ["ནྡ", 0], ["ནྡྱ", 0], ["ནྡྲ", 0], ["ནྡྷ", 0], ["ནྜ", 0], ["ནྣ", 0],
["ནྨ", 0], ["ནྫ", 0], ["ནྱ", 0], ["ནྲ", 0], ["ཎ", 0], ["ཎ", 0], ["ཎྚ", 0], ["ཎྛ", 0], ["ཎྜ", 0], ["ཎ", 0],
["ཎྞ", 0], ["ཎྨ", 0], ["ཎྱ", 0], ["པྟ", 0], ["པྡ", 0], ["པྣ", 0], ["པྥ", 0], ["པླ", 0], ["བྡ", 0], ["བྡྷ", 0],
["བྦྷ", 0], ["བྷ", 0], ["བྷྨ", 0], ["བྷྻ", 0], ["བྷྱ", 0], ["བྷྲ", 0], ["ི", 1], ["ི", 1], ["ིཾ", 1], ["ིཾ", 1],
["ྀ", 1], ["ྀཾ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1],
["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1],
["ུ", 1], ["ུ", 1], ["ེ", 1], ["ེ", 1], ["ེཾ", 1], ["ེཾ", 1], ["ཻ", 1], ["ོ", 1], ["ོ", 1], ["ༀ", 1],
["ༀ", 1], ["ཽ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1],
["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1],
["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1],
["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ནྟྲ", 0], ["ནྛ", 0]];
esama['c'] = [[" ", 2], ["མྤ", 0], ["མྦྷ", 0], ["མྦྷྱ", 0], ["མྨ", 0], ["མྶ", 0], ["ཙྩ", 0], ["ཙྪ", 0], ["ཚྪ", 0], ["ཛྙ", 0],
["ཛྙྱ", 0], ["ཛྫ", 0], ["ཛྫྷ", 0], ["ཛྭ", 0], ["ཛྱ", 0], ["ཛྲ", 0], ["ཛྷ", 0], ["ཝྱ", 0], ["ཝྲ", 0], ["ཡྻ", 0],
["ཡྶ", 0],
["རྐྟ", 0], ["རྑ", 0], ["རྒྷ", 0], ["རྟྟ", 0], ["རྚ", 0], ["རྠ", 0], ["རྠྱ", 0], ["རྔྷ", 0], ["རྞ", 0], ["ཪྤ", 0], ["རྦྟ", 0], ["རྦྤ", 0], ["རྦྦ", 0], ["རྦྷ", 0], ["རྨྨ", 0], ["རྫྙ", 0], ["རྻ", 0], ["ཪྱ", 0], ["ཪྴ", 0], ["ཪྵ", 0], ["རྷ", 0], ["ལྨ", 0], ["ལྱ", 0], ["ལླ", 0], ["ཤྣ", 0], ["ཤྨ", 0], ["ཤྩ", 0], ["ཤྻ", 0], ["ཤྱ", 0], ["ཤླ", 0], ["ཤྴ", 0], ["ཥ", 0], ["ཥ", 0], ["ཥྐ", 0], ["ཥྐྲ", 0], ["ཥྚ", 0], ["ཥྚྲ", 0], ["ཥྠ", 0], ["ཥྛ", 0], ["ཥྞ", 0], ["ཥྤ", 0], ["ཥྤྲ", 0], ["ཥྩ", 0], ["ཥྭ", 0], ["ཥྱ", 0], ["ཥླ", 0], ["ཥྵ", 0], ["སྚྱ", 0], ["སྟྲ", 0], ["སྟྲྱ", 0], ["སྠ", 0], ["སྥ", 0], ["སྦྷ", 0], ["སྱ", 0], ["སྶ", 0], ["ཧྟ", 0], ["ཧྣ", 0], ["ཧྞ", 0], ["ཧྥ", 0], ["ཧྨ", 0], ["ཧྨྱ", 0], ["ཧྱ", 0], ["ཧླ", 0], ["ཧྶ", 0], ["ཨཡ", 0], ["ཽ", 1], ["སྟྭ", 0], ["༄༅༅", 2], ["ཊྭ", 0], ["ཕྱྭ", 0], ["", 0], ["", 0], ["མྦ", 0], ["ཥྨ", 0], ["བྷཱུ", 3], ["བྷྲཱུ", 3], ["༅", 0], ["྅", 0], ["ྈ", 0], ["ྉ", 0], ["྄", 0], ["྄", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["ི", 1], ["ི", 1], ["ི", 1], ["ིཾ", 1], ["ིཾ", 1], ["ྀ", 1], ["ྀཾ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["", 0], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ེ", 1], ["ེ", 1], ["ེཾ", 1], ["ེཾ", 1], ["ཻ", 1], ["ོ", 1], ["ོ", 1], ["ༀ", 1], ["ༀ", 1], ["ཽ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 0], ["ཱ", 0], ["ཱ", 0], ["ཱ", 0], ["ཱ", 0], ["ཱ", 0], ["ཱ", 0], ["ཱ", 0], ["ཱ", 0], ["ཱ", 0], ["ཱུ", 0], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1]];
// the tables for the dedris and ededris fonts (they are the same)
var ededris = new Array();
ededris['a'] = [[" ", 2], ["ཀ", 0], ["ཁ", 0], ["ག", 0], ["ང", 0], ["ཅ", 0], ["྄", 2], ["ཆ", 0], ["ཇ", 0], ["ཉ", 0],
["ཏ", 0], ["ཐ", 0], ["་", 2], ["ད", 0], ["ན", 0], ["པ", 0], ["ཕ", 0], ["བ", 0], ["མ", 0], ["ཙ", 0],
["ཚ", 0], ["ཛ", 0], ["ཝ", 0], ["ཞ", 0], ["ཟ", 0], ["འ", 0], ["ཡ", 0], ["ར", 0], ["ལ", 0], ["ཤ", 0],
["ས", 0], ["ཧ", 0], ["ཨ", 0], ["ཊ", 0], ["ཋ", 0], ["ཌ", 0], ["ཎ", 0], ["ཥ", 0], ["ཀྱ", 0], ["ཁྱ", 0],
["གྱ", 0], ["པྱ", 0], ["ཕྱ", 0], ["བྱ", 0], ["མྱ", 0], ["ཀྲ", 0], ["ཁྲ", 0], ["གྲ", 0], ["ཏྲ", 0], ["ཐྲ", 0],
["དྲ", 0], ["པྲ", 0], ["ཕྲ", 0], ["བྲ", 0], ["མྲ", 0], ["ཤྲ", 0], ["སྲ", 0], ["ཧྲ", 0], ["ཀླ", 0], ["གླ", 0],
["བླ", 0], ["ཟླ", 0], ["རླ", 0], ["སླ", 0], ["རྐ", 0], ["རྒ", 0], ["རྔ", 0], ["རྗ", 0], ["རྙ", 0], ["རྟ", 0],
["རྡ", 0], ["རྣ", 0], ["རྦ", 0], ["རྨ", 0], ["རྩ", 0], ["རྫ", 0], ["རྐྱ", 0], ["རྒྱ", 0], ["རྨྱ", 0], ["ལྐ", 0],
["ལྒ", 0], ["ལྔ", 0], ["ལྕ", 0], ["ལྗ", 0], ["ལྟ", 0], ["ལྡ", 0], ["ལྤ", 0], ["ལྦ", 0], ["ལྷ", 0], ["སྐ", 0],
["སྒ", 0], ["སྔ", 0], ["སྙ", 0], ["", 4], ["", 4], ["", 4], ["", 4], ["", 4], ["་", 2]];
ededris['b'] = [[" ", 2], ["སྟ", 0], ["སྡ", 0], ["སྣ", 0], ["སྤ", 0], ["སྦ", 0], ["", 2], ["སྨ", 0], ["སྩ", 0], ["སྐྱ", 0], ["སྒྱ", 0], ["སྤྱ", 0], ["", 2], ["སྦྱ", 0], ["སྨྱ", 0], ["སྐྲ", 0], ["སྒྲ", 0], ["སྣྲ", 0], ["སྤྲ", 0], ["སྦྲ", 0], ["སྨྲ", 0], ["ཀྭ", 0], ["ཁྭ", 0], ["གྭ", 0], ["གྲྭ", 0], ["རྒྭ", 0], ["ཉྭ", 0], ["ཏྭ", 0], ["སྟྭ", 0], ["ཊྭ", 0], ["དྭ", 0], ["དྲྭ", 0], ["ཕྱྭ", 0], ["ཙྭ", 0], ["རྩྭ", 0], ["ཚྭ", 0], ["ཞྭ", 0], ["ཟྭ", 0], ["རྭ", 0], ["ལྭ", 0], ["ཤྭ", 0], ["སྭ", 0], ["ཧྭ", 0], ["ཀྐ", 0], ["ཀྐྲ", 0], ["ཀྑ", 0], ["ཀྒ", 0], ["ཀྒྷ", 0], ["ཀྔ", 0], ["ཀྟ", 0], ["ཀྟྭ", 0], ["ཀྟྱ", 0], ["ཀྟྲ", 0], ["ཀྚ", 0], ["ཀྠ", 0], ["ཀྛ", 0], ["ཀྡ", 0], ["ཀྡྲ", 0], ["ཀྞ", 0], ["ཀྤ", 0], ["ཀྤྲ", 0], ["ཀྦ", 0], ["ཀྨ", 0], ["ཀྩ", 0], ["ཀྫྙ", 0], ["ཀྴ", 0], ["ཀྴྱ", 0], ["ཀྵ", 0], ["ཀྵྐྵ", 0], ["ཀྵྜ", 0], ["ཀྵྞ", 0], ["ཀྵྨ", 0], ["ཀྵྭ", 0], ["ཀྵྱ", 0], ["ཀྵྲ", 0], ["ཀྵླ", 0], ["ཀྶ", 0], ["ཀྷ", 0], ["ཁྑ", 0], ["ཁྣ", 0], ["ཁླ", 0], ["ཁྷ", 0], ["གྒ", 0], ["གྔ", 0], ["གྡྷ", 0], ["གྟ", 0], ["གྟྱ", 0], ["གྡ", 0], ["གྡྷ", 0], ["གྣ", 0], ["གྣྱ", 0], ["གྞ", 0], ["གྦ", 0], ["", 4], ["", 4], ["", 4], ["", 4], ["", 4], ["་", 2]];
ededris['c'] = [[" ", 2], ["གྦྱ", 0], ["གྦྷ", 0], ["གྨ", 0], ["གྩ", 0], ["གྫ", 0], ["", 2], ["གྻ", 0], ["གྲྱ", 0], ["གྴ", 0], ["གྴྭ", 0], ["གྷ", 0], ["", 2], ["གྷྒྷ", 0], ["གྷྣ", 0], ["གྷྣྱ", 0], ["གྷྭ", 0], ["གྷྱ", 0], ["གྷྲ", 0], ["གྷླ", 0], ["ངྐ", 0], ["ངྐྟ", 0], ["ངྐྟྲ", 0], ["ངྐྱ", 0], ["ངྐྲ", 0], ["ངྑ", 0], ["ངྒ", 0], ["ངྒྱ", 0], ["ངྒླ", 0], ["ངྒྷ", 0], ["ངྒྷྲ", 0], ["ངྡྷ", 0], ["ངྡྷྱ", 0], ["ངྟ", 0], ["ངྻ", 0], ["ངྴ", 0], ["ངྵ", 0], ["ངྶ", 0], ["ངྷ", 0], ["ངྷྣ", 0], ["ངྷྣྱ", 0], ["ངྷྭ", 0], ["ངྷྱ", 0], ["ངྷྲ", 0], ["ཅྭ", 0], ["ཉྠ", 0], ["ཉྩ", 0], ["ཉྪ", 0], ["ཉྫ", 0], ["ཉྫྙ", 0], ["ཏྐ", 0], ["ཏྐྲ", 0], ["ཏྑ", 0], ["ཏྒ", 0], ["ཏྒྲ", 0], ["ཏྟ", 0], ["ཏྟྭ", 0], ["ཏྟྱ", 0], ["ཏྟྲ", 0], ["ཏྠ", 0], ["ཏྠྱ", 0], ["ཏྡྷ", 0], ["ཏྣ", 0], ["ཏྤ", 0], ["ཏྤྠ", 0], ["ཏྤྣ", 0], ["ཏྤྲ", 0], ["ཏྤྷ", 0], ["ཏྥ", 0], ["ཏྦྷ", 0], ["ཏྨ", 0], ["ཏྨྱ", 0], ["ཏྨྲ", 0], ["ཏྪ", 0], ["ཏྫ", 0], ["ཏྱ", 0], ["ཏྻ", 0], ["ཏྲྟྲ", 0], ["ཏྲྱ", 0], ["ཏྵ", 0], ["ཏྶ", 0], ["ཏྶྣ", 0], ["ཏྶྭ", 0], ["ཏྷ", 0], ["ཊྐ", 0], ["ཊྒ", 0], ["ཊྒྲ", 0], ["ཊྚ", 0], ["ཊྚྱ", 0], ["ཊྠ", 0], ["ཊྡ", 0], ["ཊྣ", 0], ["ཊྤ", 0], ["", 4], ["", 4], ["", 4], ["", 4], ["", 4], ["་", 2]];
ededris['d'] = [[" ", 2], ["ཊྥ", 0], ["ཊྤྷ", 0], ["ཊྨ", 0], ["ཊྱ", 0], ["ཊྲ", 0], ["", 2], ["ཊྵ", 0], ["ཊྶ", 0], ["ཐྭ", 0], ["ཐྱ", 0], ["ཐླྷ", 0], ["", 2], ["ཋྐ", 0], ["ཋྱ", 0], ["ཋྲ", 0], ["དྑ", 0], ["དྒ", 0], ["དྒྷ", 0], ["དྒྷྲ", 0], ["དྔ", 0], ["དྟ", 0], ["དྠ", 0], ["དྡ", 0], ["དྡྲ", 0], ["དྡྷ", 0], ["དྡྷྭ", 0], ["དྡྷྱ", 0], ["དྡྷྲ", 0], ["དྤ", 0], ["དྤྲ", 0], ["དྦ", 0], ["དྦྲ", 0], ["དྦྷ", 0], ["དྦྷྱ", 0], ["དྦྷྲ", 0], ["དྨ", 0], ["དྭྱ", 0], ["དྺ", 0], ["དྱ", 0], ["དྲྱ", 0], ["དྶ", 0], ["དྷ", 0], ["དྷྣ", 0], ["དྷྣྱ", 0], ["དྷྨ", 0], ["དྷྭ", 0], ["དྷྱ", 0], ["དྷྲ", 0], ["ཌྒ", 0], ["ཌྒྷ", 0], ["ཌྒྲ", 0], ["ཌྡྷ", 0], ["ཌྜ", 0], ["ཌྜྷ", 0], ["ཌྦྷ", 0], ["ཌྨ", 0], ["ཌྱ", 0], ["ཌྷ", 0], ["ཌྷྱ", 0], ["ཌྷྲ", 0], ["ནྐ", 0], ["ནྟ", 0], ["ནྟྭ", 0], ["ནྟྱ", 0], ["ནྟྲ", 0], ["ནྚ", 0], ["ནྠ", 0], ["ནྡ", 0], ["ནྡྟ", 0], ["ནྡྭ", 0], ["ནྡྱ", 0], ["ནྡྲ", 0], ["ནྡྷ", 0], ["ནྡྷྱ", 0], ["ནྡྷྲ", 0], ["ནྜ", 0], ["ནྣ", 0], ["ནྻ", 0], ["ནྲ", 0], ["ནླ", 0], ["ནྴ", 0], ["ནྶ", 0], ["ནྷ", 0], ["ནྔ", 0], ["", 4], ["", 4], ["", 4], ["", 4], ["", 4], ["་", 2]];
ededris['e'] = [[" ", 2], ["ཎྔྟ", 0], ["ཎྟ", 0], ["ཎྟྲ", 0], ["ཎྚ", 0], ["ཎྛ", 0], ["", 2], ["ཎྡ", 0], ["ཎྡྟ", 0], ["ཎྡྡྷ", 0], ["ཎྡྭ", 0], ["ཎྡྱ", 0], ["", 2], ["ཎྡྲ", 0], ["ཎྡྷ", 0], ["ཎྜ", 0], ["ཎྞ", 0], ["ཎྨ", 0], ["ཎྱ", 0], ["ཎྻ", 0], ["ཎྲ", 0], ["ཎྵ", 0], ["པྐྲ", 0], ["པྔྷ", 0], ["པྟ", 0], ["པྠ", 0], ["པྡ", 0], ["པྡྷ", 0], ["པྣ", 0], ["པྤ", 0], ["པྥ", 0], ["པྨ", 0], ["པྫ", 0], ["པྻ", 0], ["པླ", 0], ["པྴ", 0], ["པྶ", 0], ["པྷ", 0], ["ཕྥ", 0], ["བྐ", 0], ["བྟ", 0], ["བྠ", 0], ["བྡ", 0], ["བྡྷ", 0], ["བྥ", 0], ["བྦྷ", 0], ["བྦྷྱ", 0], ["བྨ", 0], ["བྫ", 0], ["བྻ", 0], ["བྷ", 0], ["བྷྨ", 0], ["བྷྱ", 0], ["བྷྻ", 0], ["བྷྲ", 0], ["མྒྷ", 0], ["མྟ", 0], ["མྣ", 0], ["མྞ", 0], ["མྤ", 0], ["མྤྱ", 0], ["མྤྲ", 0], ["མྥ", 0], ["མྦ", 0], ["མྦྲ", 0], ["མྦླ", 0], ["མྦྷ", 0], ["མྦྷྱ", 0], ["མྦྷྲ", 0], ["མྨ", 0], ["མྨྲ", 0], ["མྺ", 0], ["མླ", 0], ["མྴ", 0], ["མྶ", 0], ["ཙྐ", 0], ["ཙྩ", 0], ["ཙྪ", 0], ["ཙྪྭ", 0], ["ཙྪྱ", 0], ["ཙྪྲ", 0], ["ཙྱ", 0], ["ཙྻ", 0], ["ཙྲ", 0], ["ཙྴ", 0], ["ཚྪ", 0], ["ཛྙ", 0], ["ཛྙྱ", 0], ["ཛྨ", 0], ["ཛྫ", 0], ["ཛྫྙ", 0], ["ཛྫྷ", 0], ["ཛྭ", 0], ["", 4], ["", 4], ["", 4], ["", 4], ["", 4], ["་", 2]];
ededris['f'] = [[" ", 2], ["ཛྱ", 0], ["ཛྲ", 0], ["ཛྷ", 0], ["ཛྷྱ", 0], ["ཝྱ", 0], ["་", 2], ["ཝྲ", 0], ["འྭ", 0], ["ཡྦ", 0], ["ཡྻ", 0], ["ཡྶ", 0], ["་", 2], ["རྐྐ", 0], ["རྐྟ", 0], ["རྐྲ", 0], ["རྐྴ", 0], ["རྐྴྱ", 0], ["རྐྵ", 0], ["རྐྵྱ", 0], ["རྑ", 0], ["རྑྑ", 0], ["རྑྦྷ", 0], ["རྑྵ", 0], ["རྑྱྭ", 0], ["རྑྲ", 0], ["རྑྷ", 0], ["རྑྷྱ", 0], ["རྔྷ", 0], ["རྔྷྱ", 0], ["རྟྟ", 0], ["རྟྤྣྱ", 0], ["རྟྨ", 0], ["རྟྱ", 0], ["རྟྲ", 0], ["རྟྶྣྱ", 0], ["རྚ", 0], ["རྠ", 0], ["རྠྱ", 0], ["རྡྭ", 0], ["རྡྡ", 0], ["རྡྡྷ", 0], ["རྡྨ", 0], ["རྡྱ", 0], ["རྡྲ", 0], ["རྡྷ", 0], ["རྡྷྭ", 0], ["རྡྷར", 0], ["རྜ", 0], ["རྜྷྲ", 0], ["རྣྡྲ", 0], ["དྣྭ", 0], ["རྞ", 0], ["རྞྞ", 0], ["རྞྱ", 0], ["རྤྱ", 0], ["རྥ", 0], ["རྦྟ", 0], ["རྦྤ", 0], ["རྦྦ", 0], ["རྦྦྷ", 0], ["རྦྦྷྱ", 0], ["རྦྱ", 0], ["རྦྲ", 0], ["རྦྷ", 0], ["རྦྷྱ", 0], ["རྦྷྲ", 0], ["རྨྨ", 0], ["རྩྩ", 0], ["རྩྪ", 0], ["རྫྙ", 0], ["རྫྫ", 0], ["རྫྭ", 0], ["རྫྲ", 0], ["རྫྷ", 0], ["རྵྱ", 0], ["རྷ", 0], ["ཪྟ", 0], ["ཪྠ", 0], ["ཪྡ", 0], ["ཪྣྲ", 0], ["ཪྞ", 0], ["ཪྞྜ", 0], ["ཪྞྞ", 0], ["ཪྤ", 0], ["ཪྤྤ", 0], ["ཪྤྲ", 0], ["ཪྥ", 0], ["ཪྦ", 0], ["ཪྦྟ", 0], ["ཪྦྷ", 0], ["ཪྨ", 0], ["ཪྪ", 0], ["", 4], ["", 4], ["", 4], ["", 4], ["", 4], ["་", 2]];
ededris['g'] = [[" ", 2], ["ཪྺ", 0], ["ཪྱ", 0], ["རྻ", 0], ["རྻ", 0], ["ཪྴ", 0], ["་", 2], ["ཪྴྣ", 0], ["ཪྴྞ", 0], ["ཪྴྨ", 0], ["ཪྴྭ", 0], ["ཪྴྱ", 0], ["་", 2], ["ཪྵ", 0], ["ཪྵྨ", 0], ["ཪྶ", 0], ["ལྤྱ", 0], ["ལྥ", 0], ["ལྦྷ", 0], ["ལྨ", 0], ["ལྱ", 0], ["ལྱྭ", 0], ["ལྻ", 0], ["ལླ", 0], ["ལྷྭ", 0], ["ཤྟ", 0], ["ཤྚ", 0], ["ཤྣ", 0], ["ཤྞ", 0], ["ཤྨ", 0], ["ཤྩ", 0], ["ཤྩྱ", 0], ["ཤྪ", 0], ["ཤྱ", 0], ["ཤྻ", 0], ["ཤླ", 0], ["ཤྴ", 0], ["ཥྐ", 0], ["ཥྐྲ", 0], ["ཥྟ", 0], ["ཥྚ", 0], ["ཥྚྭ", 0], ["ཥྚྱ", 0], ["ཥྟྲ", 0], ["ཥྠ", 0], ["ཥྛ", 0], ["ཥྞ", 0], ["ཥྤ", 0], ["ཥྤྱ", 0], ["ཥྤྲ", 0], ["ཥྦ", 0], ["ཥྨ", 0], ["ཥྩ", 0], ["ཥྩྱ", 0], ["ཥྭ", 0], ["ཥྱ", 0], ["ཥླ", 0], ["ཥྵ", 0], ["ཥྶ", 0], ["སྑ", 0], ["སྗ", 0], ["སྟྱ", 0], ["སྟྲ", 0], ["སྟྲྱ", 0], ["སྠ", 0], ["སྥ", 0], ["སྦྷ", 0], ["སྫ", 0], ["སྱ", 0], ["སྻ", 0], ["སྴ", 0], ["སྵ", 0], ["སྶ", 0], ["ཧྟ", 0], ["ཧྣ", 0], ["ཧྞ", 0], ["ཧྥ", 0], ["ཧྨ", 0], ["ཧྨྱ", 0], ["ཧྱ", 0], ["ཧྱྭ", 0], ["ཧྻ", 0], ["ཧླ", 0], ["ཧྶ", 0], ["ཨྱ", 0], ["ཨྸ", 0], ["", 4], ["", 4], ["", 4], ["", 4], ["", 4], ["་", 2]];
// the table for the dedris-vowel font
var ededrisvow = [[" ", 2], ["༄༅", 2], ["༄༅༅", 2], ["༅", 2], ["ྃ", 2], ["ྃ", 2], ["", 2], ["ཾ", 2], ["ཾ", 2], ["༁ྃ", 2], ["ྂ", 2], ["།", 2], ["་", 2], ["༑", 2], ["༴", 2], ["༠", 2], ["༡", 2], ["༢", 2], ["༣", 2], ["༤", 2], ["༥", 2], ["༦", 2], ["༧", 2], ["༨", 2], ["༩", 2], ["ཿ", 2], ["༔", 2], ["ༀ", 2], ["ཱཿ", 2], ["ཧཱུྂ", 2], ["༈", 2], ["྅", 2], ["ི", 1], ["ི", 1], ["ི", 1], ["ིཾ", 1], ["ིཾ", 1], ["ྀ", 1], ["ྀ", 1], ["ྀཾ", 1], ["ྀཾ", 1], ["ེ", 1], ["ེ", 1], ["ེཾ", 1], ["ེཾ", 1], ["ཻ", 1], ["ཻ", 1], ["ཻཾ", 1], ["ཻཾ", 1], ["ོ", 1], ["ོ", 1], ["ༀ", 1], ["ༀ", 1], ["ོྃ", 1], ["ཽ", 1], ["ཽ", 1], ["ཽཾ", 1], ["ཽཾ", 1], ["ཀ྄", 0], ["ག྄", 0], ["ཏ྄", 0], ["ད྄", 0], ["ཌ྄", 0], ["བ྄", 0], ["མ྄", 0], ["ཙ྄", 0], ["ཛ྄", 0], ["ར྄", 0], ["ས྄", 0], ["ཙྖྒ྄ཻ", 0], ["྄", 0], ["྄", 0], ["ྈ", 0], ["ྉ", 0], ["ྈྐ", 0], ["ྈྑ", 0], ["ྉྤ", 0], ["ྉྥ", 0], ["", 2], ["འུྃ", 2], ["ཧཱུྂ", 2], ["ཨྠ", 0], ["ཨྠིྀ", 3], ["ྊྃ", 2], ["ྋྙྃ", 2], ["༵", 2], ["༵", 2], ["༷", 2], ["༷", 2], ["", 4], ["", 4], ["", 4], ["", 4], ["", 4], ["་",2]];
// the table for the dedris-syma font, which is special and called in a special way due to its limited size
var ededrisyma = {'{':'(', '}':')', '[':'(', ']':')'};
// here are the vowels of the dedris and ededris:
// vowels[1] is the vowel that is used in ededris-a1, ededris-d1, etc.
var vowels = ['', "ུ","ཱ","ཱུ"];
// The table for the Tibetan Chosgyal font by TCC
var tibchosgyal = new Array();
tibchosgyal['0'] = [[" ", 2], ["ཀ", 0], ["ཁ", 0], ["ག", 0], ["ང", 0], ["ཅ", 0], ["ཆ", 0], ["ཇ", 0], ["ཉ", 0], ["ཏ", 0],
["ཐ", 0], ["ད", 0], ["ན", 0], ["་", 0], ["ཕ", 0], ["བ", 0], ["མ", 0], ["ཙ", 0], ["ཚ", 0], ["ཛ", 0],
["ཝ", 0], ["ཞ", 0], ["ཟ", 0], ["འ", 0], ["ཡ", 0], ["ར", 0], ["ལ", 0], ["ཤ", 0], ["ས", 0], ["ཧ", 0],
["ཨ", 2], ["རྐ", 0], ["རྒ", 0], ["རྔ", 0], ["རྗ", 0], ["རྙ", 0], ["རྟ", 0], ["རྡ", 0], ["རྣ", 0], ["རྦ", 0],
["རྨ", 0], ["རྩ", 0], ["རྫ", 0], ["ལྐ", 0], ["ལྒ", 0], ["ལྔ", 0], ["ལྕ", 0], ["ལྗ", 0], ["ལྟ", 0], ["ལྡ", 0],
["ལྤ", 0], ["ལྦ", 0], ["ལྷ", 0], ["སྐ", 0], ["སྒ", 0], ["སྔ", 0], ["སྙ", 0], ["སྟ", 0], ["སྡ", 0], ["སྣ", 0],
["སྤ", 0], ["སྦ", 0], ["སྨ", 0], ["སྩ", 0], ["ཀྱ", 0], ["ཁྱ", 0], ["གྱ", 0], ["པྱ", 0], ["ཕྱ", 0], ["བྱ", 0],
["མྱ", 0], ["ཀྲ", 0], ["ཁྲ", 0], ["གྲ", 0], ["ཏྲ", 0], ["ཐྲ", 0], ["དྲ", 0], ["པྲ", 0], ["ཕྲ", 0], ["བྲ", 0],
["མྲ", 0], ["ཤྲ", 0], ["སྲ", 0], ["ཧྲ", 0], ["ཀླ", 0], ["གླ", 0], ["བླ", 0], ["ཟླ", 0], ["རླ", 0], ["སླ", 0],
["རྐྱ", 0], ["རྒྱ", 0], ["རྨྱ", 0], ["རྒྭ", 0], ["རྩྭ", 0],["སྤྱ", 0],["ཅྭ", 0],["ཏྭ", 0], ["དྭ", 0],["ཉྭ", 0],
[" ", 0], ["ཱ", 0],["ཱ", 0], ["ཱ", 0], ["ཱ", 0], ["ུ", 0], ["ུ", 0], ["ུ", 0], ["ུ", 0],["ཊ", 0],
["ཋ", 0],["ཌ", 0], ["ཎ", 0], ["ཥ", 0], ["ཀྵ", 0], ["ུ", 0], ["ུ", 0], ["ུ", 0], ["ུ", 0], ["ཀ", 0],
["ག", 0], ["ཉ", 0], ["ཏ", 0], ["ད", 0], ["ན", 0], ["ཞ", 0], ["ཤ", 0], ["ཧ", 0], ["རྟ", 0], ["༠", 0],
["༡", 0], ["༢", 0], ["༣", 0], ["༤", 0], ["༥", 0], ["༦", 0], ["༧", 0], ["༨", 0], ["༩", 0], ["༅", 0],
["༄༅", 0], ["།", 0], ["༑", 0], ["༈", 0], ["་", 0], ["༔", 0], ["༴", 0], ["༼", 0], ["༽", 0], ["༄", 0],
["ཱ", 0], ["ཱ", 0], ["ཱུ", 0], ["ཱུ", 0], ["ཱུ", 0], ["ཱུ", 0], ["ཱུ", 0], ["ཱུ", 0], ["ཱུ", 0], ["ི", 0],
["ི", 0], ["ྀ", 0], ["ུ", 0], ["ུ", 0], ["ུ", 0], ["ུ", 0], ["ུ", 0], ["ུ", 0], ["ུ", 0], ["ུ", 0],
["ུ", 0], ["ེ", 0], ["ེ", 0], ["ཻ", 0], ["ོ", 0], ["ོ", 0], ["ཽ", 0], ["ཾ", 0], ["ཿ", 0], ["ྃ", 0],
["ྂ", 0], ["ིཾ", 0], ["ིཾ", 0], ["ྀཾ", 0], ["ེཾ", 0], ["ེཾ", 0], ["ཻཾ", 0], ["ོཾ", 0], ["ོཾ", 0], ["ཽཾ", 0],
["྄", 0], ["པ", 0], ["སྐྱ", 0], ["གྭ", 0], ["ཧ", 0], ["ཀྭ", 0], ["དྲྭ", 0], ["ྭ", 0], ["སྨྱ", 0], ["སྦྲ", 0],
["ཀྵ", 0], ["ཧྭ", 0], ["ཤ", 0], ["ཁ", 0], ["ཤྭ", 0], ["སྭ", 0], ["ཙྭ", 0], ["ཚྭ", 0], ["སྦྱ", 0], ["ཞྭ", 0],
["ཟྭ", 0], ["སྐྲ", 0], ["སྣྲ", 0], ["སྤྲ", 0], ["རྭ", 0], ["སྒྲ", 0], ["སྨྲ", 0], ["ཁྭ", 0], ["ཕྱྭ", 0], ["སྒྱ", 0],
["གྲྭ", 0], ["ཏ", 0], ["ཏ", 0], ["སྤྱ", 2], ["ཅྭ", 2], ["ཏྭ", 2], ["དྭ", 2], ["ཉྭ", 2], [" ", 2], ["ཾ", 2],
["ཅྭ", 2]];
var tibchosgyalskt = new Array();
tibchosgyalskt['1'] = [[" ", 2], ["ཀྐ", 0], ["ཀྑ", 0], ["ཀྔ", 0], ["ཀྩ", 0], ["ཀྟ", 0], ["ཀྟྱ", 0], ["ཀྟྲ", 0], ["ཀྟྲྱ", 0], ["ཀྟྭ", 0],
["ཀྠ", 0], ["ཀྠྱ", 0], ["ཀྞ", 0], ["ཀྣ", 0], ["ཀྣྱ", 0], ["ཀྥ", 0], ["ཀྨ", 0], ["ཀྨྱ", 0], ["ཀྲྱ", 0], ["ཀྴ", 0],
["ཀྶ", 0], ["ཀྶྣ", 0], ["ཀྶྨ", 0], ["ཀྶྱ", 0], ["ཀྶྭ", 0], ["ྈྐ", 0], ["ྈྑ", 0], ["ཁྑ", 0], ["ཁྣ", 0], ["ཁླ", 0],
["གྒ", 0], ["གྒྷ", 0], ["གྙ", 0], ["གྡ", 0], ["གྡྷ", 0], ["གྡྷྱ", 0], ["གྡྷྭ", 0], ["གྣ", 0], ["གྣྱ", 0], ["གྤ", 0],
["གྦྷ", 0], ["གྦྷྱ", 0], ["གྨ", 0], ["གྨྱ", 0], ["གྲྱ", 0], ["གྷ", 0], ["གྷྒྷ", 0], ["གྷྙ", 0], ["གྷྣ", 0], ["གྷྣྱ", 0],
["གྷྨ", 0], ["གྷླ", 0], ["གྷྱ", 0], ["གྷྲ", 0], ["གྷྭ", 0], ["ངྐ", 0], ["ངྐྟ", 0], ["ངྐྟྱ", 0], ["ངྐྱ", 0], ["ངྑ", 0],
["ངྑྱ", 0], ["ངྒ", 0], ["ངྒྲ", 0], ["ངྒྱ", 0], ["ངྒྷ", 0], ["ངྒྷྱ", 0], ["ངྒྷྲ", 0], ["ངྔ", 0], ["ངྟ", 0], ["ངྣ", 0],
["ངྨ", 0], ["ངྱ", 0], ["ངླ", 0], ["ངྴ", 0], ["ངྷ", 0], ["ངྐྵ", 0], ["ངྐྵྭ", 0], ["ངྐྵྱ", 0], ["ཙྩ", 0], ["ཙྪ", 0],
["ཙྪྭ", 0], ["ཙྪྲ", 0], ["ཙྙ", 0], ["ཙྣྱ", 0], ["ཙྨ", 0], ["ཙྱ", 0], ["ཙྲ", 0], ["ཙླ", 0], ["ཙྷྱ", 0], ["ཚྠ", 0],
["ཚྪ", 0], ["ཚྱ", 0], ["ཚྲ", 0], ["ཚླ", 0], ["ཛྙྱ", 0], ["ཛྫྙ", 0], ["ཛྷྲ", 0], ["ཛྷྭ", 0], ["ཉྩ", 0], ["ཉྴ", 0],
[" ",0], ["ཊྤ", 0], ["ཊྨ", 0], ["ཊྱ", 0], ["ཊྭ", 0], ["ཊྶ", 0], ["ཋྲ", 0], ["ཌྒ", 0], ["ཌྒྱ", 0], ["ཌྒྷ", 0],
["ཌྒྷྲ", 0], ["ཌྜ", 0], ["ཌྜྷ", 0], ["ཌྜྷྱ", 0], ["ཌྣ", 0], ["ཌྨ", 0], ["ཌྱ", 0], ["ཌྲ", 0], ["ཌྭ", 0], ["ཌྷ", 0],
["ཌྷྜྷ", 0], ["ཌྷྨ", 0], ["ཌྷྱ", 0], ["ཌྷྲ", 0], ["ཌྷྭ", 0], ["ཎྚ", 0], ["ཎྛ", 0], ["ཎྜ", 0], ["ཎྜྱ", 0], ["ཎྜྲྱ", 0],
["ཎྜྷ", 0], ["ཎྞ", 0], ["ཎྡྲ", 0], ["ཎྨ", 0], ["ཎྱ", 0], ["ཎྭ", 0], ["ཏྐ", 0], ["ཏྐྲ", 0], ["ཏྐྶ", 0], ["",0],
["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["",0], ["",0], ["",0],
["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["",0], ["",0], ["",0],
["",0], ["",0], ["",0], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["",0],
["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0],
["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["ཛྷླ", 1], ["ཊྐ", 1], ["ཋྱ", 1], ["ཀྣ", 1],
["ཛྫྷ", 1], ["ཊྚྷ", 1], ["ཛྷྱ", 1], ["ཉླ", 1], ["ཛྭ", 1], ["ཉྱ", 1], ["ཊྚ", 1], ["ཛྙ", 1], ["ཛྱ", 1], ["ཌྣ", 1],
["ཉྤ", 1], ["ཁྑ", 1], ["ཌྷྜྷ", 1], ["ཉྫྷ", 1], ["ཉྙ", 1], ["ཉྩྨ", 1], ["ཉྩྱ", 1], ["ཛྷྫྷ", 1], ["ཉྪ", 1], ["ཉྫ", 1],
["ཛྙྱ", 1], ["ཛྣྭ", 1], ["ཛྨ", 1], ["ཉྫྱ", 1], ["ཛྣ", 1], ["ཛྲ", 1], ["ཛྷ", 1], ["ཉྲ", 1], ["ཛྫྭ", 1], ["ཉྥ", 1],
["ཌྷྱ ", 1], ["ཌྷྱ", 1], ["ཛྫྙ", 1], ["ཛྷྲ", 1], ["ཛྷྭ", 1], ["ཉྩ", 1], ["ཉྴ", 1], ["",0], ["",0], ["",0],
["ཛྷྭ",0]];
tibchosgyalskt['2'] = [[" ",0], ["ཏྐྭ",0], ["ཏྙ",0], ["ཏྛ",0], ["ཏྟ",0], ["ཏྟྱ",0], ["ཏྟྲ",0], ["ཏྟྭ",0], ["ཏྠ",0], ["ཏྠྱ",0],
["ཏྣ",0], ["ཏྣྱ",0], ["ཏྤ",0], ["",0], ["ཏྥ",0], ["ཏྨ",0], ["ཏྨྱ",0], ["ཏྱ",0], ["ཏྲྣ",0], ["ཏྶ",0],
["ཏྶྠ",0], ["ཏྶྣ", 0], ["ཏྶྣྱ", 0], ["ཏྶྨ", 0], ["ཏྶྨྱ", 0], ["ཏྶྱ", 0], ["ཏྶྲ", 0], ["ཏྶྭ", 0], ["ཏྲྱ", 0], ["ཏྭྱ", 0],
["ཏྐྵ", 0], ["ཐྱ", 0], ["ཐྭ", 0], ["དྒ", 0], ["དྒྱ", 0], ["དྒྲ", 0], ["དྒྷ", 0], ["དྒྷྲ", 0], ["དྫ", 0], ["དྡ", 0],
["དྡྱ", 0], ["དྡྲ", 0], ["དྡྭ", 0], ["དྡྷ", 0], ["དྡྷྣ", 0], ["དྡྷྱ", 0], ["དྡྷྲ", 0], ["དྡྷྭ", 0], ["དྣ", 0], ["དྦ", 0],
["དྦྲ", 0], ["དྦྷ", 0], ["དྦྷྱ", 0], ["དྦྷྲ", 0], ["དྨ", 0], ["དྱ", 0], ["དྲྱ", 0], ["དྭྱ", 0], ["དྷ", 0], ["དྷྣ", 0],
["དྷྣྱ", 0], ["དྷྨ", 0], ["དྷྱ", 0], ["དྷྲ", 0], ["དྷྲྱ", 0], ["དྷྭ", 0], ["ནྐ", 0], ["ནྐྟ", 0], ["",0], ["ནྒྷ", 0],
["ནྔ", 0], ["ནྫ", 0], ["ནྫྱ", 0], ["ནྜ", 0], ["ནྟ", 0], ["ནྟྱ", 0], ["ནྟྲ", 0], ["ནྟྲྱ", 0], ["ནྟྭ", 0], ["ནྟྶ", 0],
["ནྠ", 0], ["ནྡ", 0], ["ནྡྡ", 0], ["ནྡྡྲ", 0], ["ནྡྱ", 0], ["ནྡྲ", 0], ["ནྡྷ", 0], ["ནྡྷྲ", 0], ["ནྡྷྱ", 0], ["ནྣ", 0],
["",0], ["ནྣྱ", 0], ["ནྤ", 0], ["ནྤྲ", 0], ["ནྥ", 0], ["ནྩ", 0], ["པྣ", 0], ["པྤ", 0], ["པྨ", 0], ["བྟ", 0],
[" ", 0], ["བྦྷ", 0], ["བྨ", 0], ["བྷ", 0], ["བྷྞ", 0], ["བྷྣ", 0], ["བྷྱ", 0], ["བྷྲ", 0], ["བྷྭ", 0], ["མྙ", 0],
["མྞ", 0], ["མྣ", 0], ["མྣྱ", 0], ["མྤ", 0], ["མྤྲ", 0], ["མྥ", 0], ["མྦ", 0], ["མྦྷ", 0], ["མྦྷྱ", 0], ["མྨ", 0],
["མླ", 0], ["མྭ", 0], ["མྶ",0], ["མྷ", 0], ["ཡྻ", 0], ["ཡྲ", 0], ["ཡྭ", 0], ["ཡྶ", 0], ["རྑ", 0], ["རྒྷ", 0],
["རྒྷྱ", 0], ["རྩྱ", 0], ["རྪ", 0], ["རྫྙ", 0], ["རྫྱ", 0], ["རྚ", 0], ["རྛ", 0], ["རྜ", 0], ["རྞ", 0], ["",0],
["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["",0], ["",0], ["",0],
["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["",0], ["",0], ["",0],
["",0], ["",0], ["",0], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1],
["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0],
["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["པྣྱ",0], ["བྣ",0], ["བྷྨ",0], ["ཏྤྲ",0], ["ནྨ",0],
["བྦྷ",0],["པྟྲྱ ",0], ["བྡྷྭ",0], ["པྟ",0], ["བྡྫ",0], ["བྦ",0], ["ནྲ",0], ["ནྷ",0], ["",0], ["བྫ",0],
["",0], ["བྫ",0], ["པྶྱ",0], ["བྒྷ",0], ["པླ",0], ["པྭ",0], ["ནྱ",0], ["པྶ",0], ["པྶྣྱ",0], ["ནྭ",0],
["ནྶ",0], ["ནྶྱ",0], ["པྶྭ",0], ["ནྭྱ",0], ["ནྷྲ",0], ["པྟྱ",0], ["བྡྷ",0], ["ནྦྷྱ",0], ["བྡ",0], ["ནྩ",0],
["པྣ",0], ["པྤ",0], ["པྨ",0], ["བྟ",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0]
, ["",0]];
// in this font, some glyphs are not yet standardized in Unicode,
// mostly those in http://www.thlib.org/reference/transliteration/#!essay=/thl/ewts/7/
// sadly, TCC fonts (such as ChogyalUnicode) don't follow the conventions
// described in this page, so the script cannot convert those glyphs...
// When they will be encountered, the characters "༠༠༠༠" will appear, in order for the user to know when this happens
tibchosgyalskt['3'] = [[" ",0], ["རྟྭ", 0], ["རྟྟ", 0], ["རྟྶ", 0], ["རྟྶྣ", 0], ["རྟྶྣྱ", 0], ["རྠ", 0], ["རྠྱ", 0], ["རྡྡྷ", 0], ["རྡྡྷྱ", 0],
["རྡྱ", 0], ["རྡྷ", 0], ["རྡྷྨ", 0], ["",0], ["རྡྷྲ", 0], ["རྤ", 0], ["རྦྤ", 0], ["རྦྦ", 0], ["རྦྷ", 0], ["རྨྨ", 0],
["རྻ", 0], ["ཪྴ", 0], ["ཪྴྱ", 0], ["ཪྵ", 0], ["ཪྵྞ", 0], ["ཪྵྞྱ", 0], ["ཪྵྨ", 0], ["ཪྵྱ", 0], ["ཪྶ", 0], ["རྷ", 0],
["རྐྵ", 0], ["ལྒྭ", 0], ["ལྦྱ", 0], ["ལྨ", 0], ["ལྱ", 0], ["ལྭ", 0], ["ལླ", 0], ["ཝྱ", 0], ["ཝྲ", 0], ["ཤྩ", 0],
["ཤྩྱ", 0], ["ཤྪ", 0], ["ཤྞ", 0], ["ཤྣ", 0], ["ཤྤ", 0], ["ཤྦྱ", 0], ["ཤྨ", 0], ["ཤྱ", 0], ["ཤྲྱ", 0], ["ཤླ", 0],
["ཤྭྒ", 0], ["ཤྭྱ", 0], ["ཤྴ", 0], ["ཥྐ", 0], ["ཥྐྲ", 0], ["ཥྚ", 0], ["ཥྚྱ", 0], ["ཥྚྲ", 0], ["ཥྚྲྱ", 0], ["ཥྚྭ", 0],
["ཥྛ", 0], ["ཥྛྱ", 0], ["ཥྞ", 0], ["ཥྞྱ", 0], ["ཥྜ", 0], ["ཥྤ", 0], ["ཥྤྲ", 0], ["ཥྨ", 0], ["ཥྱ", 0], ["ཥྭ", 0],
["ཥྵ", 0], ["སྐྶ", 0], ["སྑ", 0], ["སྩྱ", 0], ["སྚ", 0], ["སྛ", 0], ["སྟྱ", 0], ["སྟྲ", 0], ["སྟྭ", 0], ["སྠ", 0],
["སྠྱ", 0], ["སྣྱ", 0], ["སྣྭ", 0], ["སྥ", 0], ["སྥྱ", 0], ["སྱ", 0], ["སྲྭ", 0], ["སྶ", 0], ["སྶྭ", 0], ["སྷ", 0],
["སྭྱ", 0], ["ཧྙ", 0], ["ཧྞ", 0], ["ཧྟ", 0], ["ཧྣ", 0], ["ཧྥ", 0], ["ཀྵླ", 0], ["ཨྱ", 0], ["ཨྲ", 0], ["",0],
[" ", 0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0],
["",0], ["",0], ["",0], [" ༹", 0], ["ྱ", 0], ["ྲ", 0] ["ྲ", 0], ["྅", 0], ["ྈ", 0], ["༁", 0],
["༠༠༠༠", 0], ["༠༠༠༠", 0], ["༠༠༠༠", 0], ["༠༠༠༠", 0], ["༠༠༠༠", 0], ["༠༠༠༠", 0], ["༠༠༠༠", 0], ["༠༠༠༠", 0], ["ཊྣ", 0], ["ཏྒ", 0],
["པྡ", 0], ["ཥྠ", 0], ["ཀྭྱ", 0], ["ཎྜྲ", 0], ["ཝྺ", 0], ["ཝྣ", 0], ["ཪྺ", 0], ["ལྷྭ", 0], ["ཱ", 1], ["",0],
["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["",0], ["",0], ["",0],
["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["",0], ["",0], ["",0],
["",0], ["",0], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1],
["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0],
["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["ཀྵྭ", 0], ["",0], ["",0],
["རྡྷྱ", 0], ["ཧྣྱ", 0], ["",0], ["ཀྵྼ", 0], ["",0], ["ཀྵྨྱ", 0], ["",0], ["",0], ["ཧྱ", 0], ["ཀྵྞ", 0],
["ྱ", 0], ["ཪྵྱ", 0], ["༠༠༠༠", 0], ["",0], ["",0], ["",0], ["ཨྲྱ", 0], ["",0], ["ཧྨ", 0], ["",0],
["",0], ["ཧླ", 0], ["ཧྶྭ", 0], ["ཧྭྱ", 0], ["",0], ["ཧྶ", 0], ["ཀྵྨ", 0], ["ཀྵྱ", 0], ["",0], ["ཧྤ", 0],
["༠༠༠༠", 0], ["༠༠༠༠", 0], ["༠༠༠༠", 0], ["ཧྥ", 0], ["ཀྵླ", 0], ["ཨྱ", 0], ["ཨྲ", 0], ["",0], ["",0], ["",0],
["",0]];
tibchosgyalskt['4'] = [[" ",0], ["༊",0], ["࿐",0], ["࿑",0], ["༉",0], ["༠༠༠༠",0], ["༆",0], ["༇",0], ["༏",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༐",0], ["༠༠༠༠",0], ["",0], ["༠༠༠༠",0], ["༈",0], ["༒",0], ["",0], ["༠", 2], ["༡", 2],
["༢", 2], ["༣", 2], ["༤", 2], ["༥", 2], ["༦", 2], ["༧", 2], ["༨", 2], ["༩", 2], ["༠", 2], ["༡", 2],
["༢", 2], ["༣", 2], ["༤", 2], ["༥", 2], ["༦", 2], ["༧", 2], ["༨", 2], ["༩", 2], ["༳", 2], ["༪", 2],
["༫", 2], ["༬", 2], ["༭", 2], ["༮", 2], ["༯", 2], ["༰", 2], ["༱", 2], ["༲", 2], ["࿀", 2], ["࿁", 2],
["࿂", 2], ["࿃", 2], ["༠༠༠༠",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༓",0], ["༺",0], ["༻",0], ["࿕",0], ["࿖",0],["࿚",0], ["࿙",0], ["༷",0],
["༵",0], ["༸",0], ["༠༠༠༠",0], ["྿",0], ["༶",0], ["྇",0], ["྆",0], ["ྉ",0], ["ྊ",0], ["ྋ",0],
["",0], ["",0], ["",0], ["༚",0], ["༝",0], ["༛",0], ["༞",0], ["༟",0], ["༜",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["",0], ["",0], ["",0], ["",0], ["",0],
[" ",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0],
["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0],
["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["࿄",0],
["࿅",0], ["࿆",0], ["࿇",0], ["࿈",0], ["࿉",0], ["࿊",0], ["࿋",0], ["࿌",0], ["",0], ["ཀ",0],
["ཁ",0], ["ག",0], ["གྷ",0], ["ང",0], ["ཅ",0], ["ཆ",0], ["ཇ",0], ["ཉ",0], ["ཊ",0], ["ཋ",0],
["ཌ",0], ["ཌྷ",0], ["ཎ",0], ["ཏ",0], ["ཐ",0], ["ད",0], ["དྷ",0], ["ན",0], ["པ",0], ["ཕ",0],
["བ",0], ["བྷ",0], ["མ",0], ["ཙ",0], ["ཚ",0], ["ཛ",0], ["ཛྷ",0], ["ཝ",0], ["ཞ ",0], ["ཟ",0],
["འ",0], ["ཡ",0], ["ཪ",0], ["ལ",0], ["ཤ",0], ["ཥ",0], ["ས",0], ["ཧ",0], ["ཨ",0], ["",0],
["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0],
["",0], ["",0], ["",0], ["ཀྵ",0], ["ོའི",0], ["",0], ["བ༹",0], ["",0], ["༗",0], ["",0],
["",0], ["",0], ["༠༠༠༠",0], ["",0], ["",0], ["",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༖",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༘",0], ["༿",0], ["༾",0], ["༠༠༠༠",0], ["༙",0], ["",0], ["",0], ["漢",0], ["",0],
["ཕ༹",0], [" ",0], ["༠༠༠༠",0], ["༕",0], ["",0], ["",0], ["",0], ["",0], ["",0], ["",0]
, ["",0]];
tibchosgyalskt['5'] = [[" ",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0], ["༠༠༠༠",0],
["༠༠༠༠",0]];
// XXX: a "feature of Tibetan Classic Skt2 is that 52 and 53 are switched compared to Tibetan Chogyal Skt2...
var tibclassic = tibchosgyal;
var tibclassicskt = new Array();
tibclassicskt[1] = tibchosgyalskt[1];
tibclassicskt[2] = tibchosgyalskt[2].slice(0);
var tmp = tibclassicskt[2][53];
tibclassicskt[2][53] = tibclassicskt[2][52];
tibclassicskt[2][52] = tmp;
tibclassicskt[3] = tibchosgyalskt[3];
tibclassicskt[4] = tibchosgyalskt[4];
tibclassicskt[5] = tibchosgyalskt[5];
// The table for the TibetanMachineWeb fonts
var tibmachweb = new Array();
tibmachweb['0'] = [[" ", 2], ["ཀ", 0], ["ཁ", 0], ["ག", 0], ["ང", 0], ["ཅ", 0], ["ཆ", 0], ["ཇ", 0], ["ཉ", 0], ["ཏ", 0],
["ཐ", 0], ["ད", 0], ["ན", 0], ["་", 2], ["པ", 0], ["ཕ", 0], ["བ", 0], ["མ", 0], ["ཙ", 0], ["ཚ", 0],
["ཛ", 0], ["ཝ", 0], ["ཞ", 0], ["ཟ", 0], ["འ", 0], ["ཡ", 0], ["ར", 0], ["ལ", 0], ["ཤ", 0], ["ས", 0],
["ཧ", 0], ["ཨ", 2], ["ཊ", 0], ["ཋ", 0], ["ཌ", 0], ["ཎ", 0], ["ཥ", 0], ["ཀྵ", 0], ["རྐ", 0], ["རྒ", 0],
["རྔ", 0], ["རྗ", 0], ["རྙ", 0], ["རྟ", 0], ["རྔ", 0], ["རྣ", 0], ["རྦ", 0], ["རྨ", 0], ["རྩ", 0], ["རྫ", 0], ["ལྐ", 0], ["ལྒ", 0], ["ལྔ", 0], ["ལྕ", 0], ["ལྗ", 0], ["ལྟ", 0], ["ལྔ", 0], ["ལྤ", 0], ["ལྦ", 0], ["ལྷ", 0], ["ཀ", 0], ["ག", 0], ["ཉ", 0], ["ཏ", 0], ["ན", 0], ["ཉ", 0], ["ཤ", 0], ["ཧ", 0], ["རྟ", 0], ["ཧ", 0], ["༑", 0], ["༈", 0], ["༔", 0], ["༴", 0], ["།", 0], ["༌", 2], ["ི", 1], ["ི", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ེ", 1], ["ེ", 1], ["ོ", 1], ["ོ", 1], ["ཁ", 0], ["ར", 0], ["ད", 0], ["ད", 0], ["ཇ", 0], [" ", 2], ["་", 2]];
tibmachweb['1'] = [[" ", 2], ["སྐ", 0], ["སྒ", 0], ["སྙ", 0], ["སྟ", 0], ["སྡ", 0], ["སྣ", 0], ["སྤ", 0], ["སྦ", 0], ["སྨ", 0], ["སྩ", 0], ["ཀྭ", 0], ["་", 2], ["ཁྭ", 0], ["གྭ", 0], ["ཅྭ", 0], ["ཉྭ", 0], ["ཏྭ", 0], ["ངྭ", 0], ["ཙྭ", 0], ["ཚྭ", 0], ["ཞྭ", 0], ["ཟྭ", 0], ["རྭ", 0], ["ཤྭ", 0], ["སྭ", 0], ["ཧྭ", 0], ["ཀྱ", 0], ["ཁྱ", 0], ["གྱ", 0], ["པྱ", 0], ["ཕྱ", 0], ["བྱ", 0], ["མྱ", 0], ["ཀྲ", 0], ["ཁྲ", 0], ["གྲ", 0], ["ཏྲ", 0], ["ཐྲ", 0], ["དྲ", 0], ["པྲ", 0], ["ཕྲ", 0], ["བྲ", 0], ["མྲ", 0], ["ཤྲ", 0], ["སྲ", 0], ["ཧྲ", 0], ["ཀླ", 0], ["གླ", 0], ["བླ", 0], ["ཟླ", 0], ["རླ", 0], ["སླ", 0], ["རྐྱ", 0], ["རྒྱ", 0], ["རྨྱ", 0], ["རྒྭ", 0], ["རྩྭ", 0], ["སྐྱ", 0], ["སྤྱ", 0], ["སྦྱ", 0], ["སྨྱ", 0], ["སྒྲ", 0], ["སྣྲ", 0], ["སྤྲ", 0], ["སྦྲ", 0], ["སྨྲ", 0], ["གྲྭ", 0], ["དྲྭ", 0], ["ཕྱྭ", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["སྒ", 0], ["སྐྲ", 0], ["སྐྲ", 0], ["སྣ", 0], [" ", 2], ["་", 2]];
tibmachweb['2'] = [[" ", 2], ["ཀྐ", 0], ["ཀྔ", 0], ["ཀྩ", 0], ["ཀྟ", 0], ["ཀྟྱ", 0], ["ཀྟྲ", 0], ["ཀྟྲྱ", 0], ["ཀྟྭ", 0], ["ཀྠ", 0], ["ཀྠྱ", 0], ["ཀྞ", 0], ["་", 2], ["ཀྣ", 0], ["ཀྣྱ", 0], ["ཀྥ", 0], ["ཀྨ", 0], ["ཀྨྱ", 0], ["ཀྲྱ", 0], ["ཀྭྱ", 0], ["ཀྴ", 0], ["ཀྶ", 0], ["ཀྶྣ", 0], ["ཀྶྨ", 0], ["ཀྶྱ", 0], ["ཀྶྭ", 0], ["ྈྐ", 0], ["ྈྑ", 0], ["ཁྑ", 0], ["ཁྣ", 0], ["ཁླ", 0], ["གྒ", 0], ["གྒྷ", 0], ["གྙ", 0], ["གྔ", 0], ["གྔྷ", 0], ["གྔྷྱ", 0], ["གྔྷྭ", 0], ["གྣ", 0], ["གྣྱ", 0], ["གྤ", 0], ["གྦྷ", 0], ["གྦྷྱ", 0], ["གྨ", 0], ["གྨྱ", 0], ["གྲྱ", 0], ["གྷ", 0], ["གྷྒྷ", 0], ["གྷྙ", 0], ["གྷྣ", 0], ["གྷྣྱ", 0], ["གྷྨ", 0], ["གྷླ", 0], ["གྷྱ", 0], ["གྷྲ", 0], ["གྷྭ", 0], ["ངྐ", 0], ["ངྐྟ", 0], ["ངྐྟྱ", 0], ["ངྐྱ", 0], ["ངྑ", 0], ["ངྑྱ", 0], ["ངྒ", 0], ["ངྒྱ", 0], ["ངྒྷ", 0], ["ངྒྷྱ", 0], ["ངྒྷྲ", 0], ["ངྔ", 0], ["ངྟ", 0], ["ངྣ", 0], ["ངྨ", 0], ["ངྱ", 0], ["ངྨ", 0], ["ངྴ", 0], ["ངྷ", 0], ["ངྐྴ", 0], ["ངྐྴྭ", 0], ["ངྐྴྱ", 0], ["ཙྩ", 0], ["ཙྪ", 0], ["ཙྪྭ", 0], ["ཙྪྲ", 0], ["ཙྙ", 0], ["ཙྣྱ", 0], ["ཙྨ", 0], ["ཙྱ", 0], ["ཙྲ", 0], ["ཙླ", 0], ["ཙྷྱ", 0], ["ཙྠ", 0], ["ཚྪ", 0], ["ཚྱ", 0], ["ཚྲ", 0], ["ཀྑ", 0], ["ངྒྲ", 0], ["ངྒྲ", 0], ["ཀྟྲ", 0], [" ", 2], ["་", 2]];
tibmachweb['3'] = [[" ", 2], ["ཚླ", 0], ["ཛྫྙ", 0], ["ཛྫྭ", 0], ["ཛྫྷ", 0], ["ཛྷྫྷ", 0], ["ཛྙ", 0], ["ཛྙྱ", 0], ["ཛྣ", 0], ["ཛྣྭ", 0], ["ཛྨ", 0], ["ཛྱ", 0], ["་", 2], ["ཛྲ", 0], ["ཛྭ", 0], ["ཛྷ", 0], ["ཛྷྱ", 0], ["ཛྷྲ", 0], ["ཛྷླ", 0], ["ཛྷྭ", 0], ["ཉྩ", 0], ["ཉྩླ", 0], ["ཉྩྱ", 0], ["ཉྩ", 0], ["ཉྫ", 0], ["ཉྫྱ", 0], ["ཉྫྷ", 0], ["ཉྙ", 0], ["ཉྤ", 0], ["ཉྥ", 0], ["ཉྱ", 0], ["ཉྲ", 0], ["ཉླ", 0], ["ཉྴ", 0], ["ཊྐ", 0], ["ཊྚ", 0], ["ཊྚྷ", 0], ["ཊྣ", 0], ["ཊྤ", 0], ["ཊྨ", 0], ["ཊྱ", 0], ["ཊྭ", 0], ["ཊྶ", 0], ["ཋྱ", 0], ["ཋྲ", 0], ["ཌྒ", 0], ["ཌྒྱ", 0], ["ཌྒྷ", 0], ["ཌྒྷྲ", 0], ["ཌྜ", 0], ["ཌྜྷ", 0], ["ཌྜྷྱ", 0], ["ཌྣ", 0], ["ཌྨ", 0], ["ཌྱ", 0], ["ཌྲ", 0], ["ཌྭ", 0], ["ཌྷ", 0], ["ཌྷྜྷ", 0], ["ཌྷྨ", 0], ["ཌྷྱ", 0], ["ཌྷྲ", 0], ["ཌྷྭ", 0], ["ཎྛ", 0], ["ཎྜ", 0], ["ཎྜྻ", 0], ["ཎྜྲ", 0], ["ཎྜྼྱ", 0], ["ཎྜྷ", 0], ["ཎྞ", 0], ["ཎྡྲ", 0], ["ཎྨ", 0], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ཛྫ", 0], ["ཎྚ", 0], ["ཎྚ", 0], ["ཛྙ", 0], [" ", 2], ["་", 2]];
tibmachweb['4'] = [[" ", 2], ["ཎྱ", 0], ["ཏྐ", 0], ["ཏྐྲ", 0], ["ཏྐྭ", 0], ["ཏྐྶ", 0], ["ཏྒ", 0], ["ཏྙ", 0], ["ཏྛ", 0], ["ཏྟ", 0], ["ཏྟྱ", 0], ["ཏྟྲ", 0], ["་", 2], ["ཏྟྭ", 0], ["ཏྠ", 0], ["ཏྠྱ", 0], ["ཏྣ", 0], ["ཏྣྱ", 0], ["ཏྤ", 0], ["ཏྤྲ", 0], ["ཏྥ", 0], ["ཏྨ", 0], ["ཏྨྱ", 0], ["ཏྱ", 0], ["ཏྲྣ", 0], ["ཏྶ", 0], ["ཏྶྠ", 0], ["ཏྶྣ", 0], ["ཏྶྣྱ", 0], ["ཏྶྨ", 0], ["ཏྶྨྱ", 0], ["ཏྶྱ", 0], ["ཏྶྲ", 0], ["ཏྶྭ", 0], ["ཏྲྭ", 0], ["ཏྭྱ", 0], ["ཏྐྵ", 0], ["ཐྱ", 0], ["ཐྭ", 0], ["དྒ", 0], ["དྒྱ", 0], ["དྒྲ", 0], ["དྒྷ", 0], ["དྒྷྲ", 0], ["དྫ", 0], ["དྡ", 0], ["དྡྱ", 0], ["དྡྲ", 0], ["དྡྭ", 0], ["དྡྷ", 0], ["དྡྷྣ", 0], ["དྡྷྱ", 0], ["དྡྷྲ", 0], ["དྡྷྭ", 0], ["དྣ", 0], ["དྦ", 0], ["དྦྲ", 0], ["དྦྷ", 0], ["དྦྷྱ", 0], ["དྦྷྲ", 0], ["དྨ", 0], ["དྱ", 0], ["དྲྱ", 0], ["དྷ", 0], ["དྷྣ", 0], ["དྷྣྱ", 0], ["དྷྨ", 0], ["དྷྱ", 0], ["དྷྲ", 0], ["དྷྲྱ", 0], ["དྷྭ", 0], ["ནྐ", 0], ["ནྐྟ", 0], ["ནྒྷ", 0], ["ནྔ", 0], ["ནྫ", 0], ["ནྫྱ", 0], ["ནྜ", 0], ["ནྟ", 0], ["ནྟྱ", 0], ["ནྟྲ", 0], ["ནྟྲྱ", 0], ["ནྟྭ", 0], ["ནྟྶ", 0], ["ནྠ", 0], ["ནྡ", 0], ["ནྡྡ", 0], ["ནྡྡྲ", 0], ["ནྡྱ", 0], ["ནྡྷ", 0], ["ནྡྷྲ", 0], ["ནྡྷྱ", 0], ["ཎྭ", 0], ["དྭྱ", 0], ["ཊྒ", 0], [" ", 2], ["་", 2]];
tibmachweb['5'] = [[" ", 2], ["ནྣ", 0], ["ནྤ", 0], ["ནྤྲ", 0], ["ནྥ", 0], ["ནྦྷྱ", 0], ["ནྨ", 0], ["ནྩ", 0], ["ནྱ", 0], ["ནྲ", 0], ["ནྭ", 0], ["ནྭྱ", 0], ["་", 2], ["ནྶ", 0], ["ནྶྱ", 0], ["ནྷ", 0], ["ནྷྲ", 0], ["པྟ", 0], ["པྟྱ", 0], ["པྟྲྱ", 0], ["པྡ", 0], ["པྣ", 0], ["པྣྱ", 0], ["པྤ", 0], ["པྨ", 0], ["པླ", 0], ["པྭ", 0], ["པྶ", 0], ["པྶྣྱ", 0], ["པྶྭ", 0], ["པྶྱ", 0], ["བྒྷ", 0], ["བྫ", 0], ["བྡ", 0], ["བྡྫ", 0], ["བྡྷ", 0], ["བྟ", 0], ["བྣ", 0], ["བྦ", 0], ["བྦྷ", 0], ["བྨ", 0], ["བྷ", 0], ["བྷྞ", 0], ["བྷྣ", 0], ["བྷྨ", 0], ["བྷྱ", 0], ["བྷྲ", 0], ["བྷྭ", 0], ["མྙ", 0], ["མྞ", 0], ["མྣ", 0], ["མྣྱ", 0], ["མྤ", 0], ["མྤྲ", 0], ["མྥ", 0], ["མྦ", 0], ["མྦྷ", 0], ["མྦྷྱ", 0], ["མྨ", 0], ["མླ", 0], ["མྭ", 0], ["མྷ", 0], ["ཡྻ", 0], ["ཡྲ", 0], ["ཡྭ", 0], ["ཡྶ", 0], ["རྑ", 0], ["ཀྒྷ", 0], ["ཀྒྷྱ", 0], ["རྩྱ", 0], ["ཱ", 0], ["ཱ", 0], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ནྣྱ", 0], ["མྶ", 0], ["མྶ", 0], ["ནྨ", 0], [" ", 2], ["་", 2]];
tibmachweb['6'] = [[" ", 2], ["རྩ", 0], ["རྫྱ", 0], ["རྚ", 0], ["རྛ", 0], ["རྜ", 0], ["རྞ", 0], ["རྟྭ", 0], ["རྟྟ", 0], ["རྟྶ", 0], ["རྟྶྣ", 0], ["རྟྶྣྱ", 0], ["་", 2], ["རྠ", 0], ["རྠྱ", 0], ["རྡྡྷ", 0], ["རྡྡྷྱ", 0], ["རྡྱ", 0], ["རྡྷ", 0], ["རྡྷྨ", 0], ["རྡྷྱ", 0], ["རྡྷྲ", 0], ["རྤ", 0], ["རྦྤ", 0], ["རྦྦ", 0], ["རྦྷ", 0], ["རྨྨ", 0], ["རྻ", 0], ["ཪྺ", 0], ["ཪྴ", 0], ["ཪྴྱ", 0], ["ཪྵ", 0], ["ཪྵྞ", 0], ["ཪྵྞྱ", 0], ["ཪྵྨ", 0], ["ཪྵྱ", 0], ["ཪྶ", 0], ["རྷ", 0], ["རྐྵ", 0], ["ལྒྭ", 0], ["ལྦྱ", 0], ["ལྨ", 0], ["ལྱ", 0], ["ལྭ", 0], ["ལླ", 0], ["ལྷྭ", 0], ["ཝྱ", 0], ["ཝྲ", 0], ["ཝྣ", 0], ["ཝྺ", 0], ["ཤྩ", 0], ["ཤྩྱ", 0], ["ཤྪ", 0], ["ཤྞ", 0], ["ཤྣ", 0], ["ཤྤ", 0], ["ཤྦྱ", 0], ["ཤྨ", 0], ["ཤྱ", 0], ["ཤྲྱ", 0], ["ཤླ", 0], ["ཤྭྒ", 0], ["ཤྭྱ", 0], ["ཥྐ", 0], ["ཥྐྲ", 0], ["ཥྚ", 0], ["ཥྚྱ", 0], ["ཥྚྲ", 0], ["ཥྚྲྱ", 0], ["ཥྚྭ", 0], ["ཥྛ", 0], ["ཥྛྱ", 0], ["ཥྞ", 0], ["ཥྞྱ", 0], ["ཥྜ", 0], ["ཥྠ", 0], ["ཥྤ", 0], ["ཥྤྲ", 0], ["ཥྨ", 0], ["ཥྱ", 0], ["ཥྭ", 0], ["ཥྵ", 0], ["སྐྶ", 0], ["སྑ", 0], ["སྩྱ", 0], ["སྚ", 0], ["སྛ", 0], ["སྟྱ", 0], ["སྟྲ", 0], ["སྟྭ", 0], ["སྠ", 0], ["སྠྱ", 0], ["སྣྱ", 0], ["རྫྙ", 0], ["ཤྴ", 0], ["ཤྴ", 0], ["རྞ", 0], [" ", 2], ["་", 2]];
tibmachweb['7'] = [[" ", 2], ["སྣྭ", 0], ["སྥྱ", 0], ["སྱ", 0], ["སྲྭ", 0], ["སྶ", 0], ["སྶྭ", 0], ["སྷ", 0], ["སྭྱ", 0], ["ཧྙ", 0], ["ཧྞ", 0], ["ཧྟ", 0], ["་", 2], ["ཧྣ", 0], ["ཧྣྱ", 0], ["ཧྤ", 0], ["ཧྥ", 0], ["ཧྨ", 0], ["ཧྱ", 0], ["ཧྨ", 0], ["ཧྶ", 0], ["ཧྶྭ", 0], ["ཧྭྱ", 0], ["ཀྵྞ", 0], ["ཀྵྨ", 0], ["ཀྵྱ", 0], ["ཀྵྼ", 0], ["ཀྵླ", 0], ["ཀྵྭ", 0], ["ཨཡ", 0], ["ཨར", 0], ["ཨརཡ", 0], ["ར", 0], ["༹", 0], ["", 0], ["ྭ", 0], ["ྱ", 0], ["ྲ", 0], ["ྈ", 0], ["༁", 0], ["ཨྠིྀ", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["", 0], ["ྀ", 1], ["ཻ", 1], ["ཽ", 1], ["ཾ", 1], ["ཾ", 1], ["ཿ", 1], ["྅", 2], ["ྃ", 1], ["ྂ", 1], ["ིཾ", 1], ["ྀཾ", 1], ["ྀཾ", 1], ["ེཾ", 1], ["ེཾ", 1], ["ཻཾ", 1], ["ༀ", 1], ["ༀ", 1], ["ཽཾ", 1], ["྄", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["ུ", 1], ["སྥ", 0], ["ིཾ", 1], ["སྶྭ", 0], [" ", 2], ["་", 2]];
tibmachweb['8'] = [[" ", 2], ["༊", 2], ["࿑", 2], ["༉", 2], ["", 2], ["༄", 2], ["༅", 2], ["༄༅", 2], ["༆", 2], ["༇", 2], ["༏", 2], ["", 2], ["༌", 2], ["", 2], ["༁༠", 2], ["", 2], ["", 2], ["", 2], ["༁༢", 2], ["", 2], ["༠", 2], ["༡", 2], ["༢", 2], ["༣", 2], ["༤", 2], ["༥", 2], ["༦", 2], ["༧", 2], ["༨", 2], ["༩", 2], ["༠", 2], ["༡", 2], ["༢", 2], ["༣", 2], ["༤", 2], ["༥", 2], ["༦", 2], ["༧", 2], ["༨", 2], ["༩", 2], ["༳", 2], ["༪", 2], ["༫", 2], ["༬", 2], ["༭", 2], ["༮", 2], ["༯", 2], ["ུ༣༠", 2], ["ུ༣༡", 2], ["༲", 2], ["࿀", 2], ["࿁", 2], ["࿃", 2], ["࿂", 2], ["", 2], ["", 2], ["", 2], ["", 2], ["", 2], ["༓", 2], ["༼", 2], ["༽", 2], ["༺", 2], ["࿕", 2], ["ུཌ༦", 2], ["࿙", 2], ["ུཌཱ", 2], ["༷", 2], ["༵", 2], ["༸", 2], ["྾", 2], ["྿", 2], ["༶", 2], ["྇", 2], ["྆", 2], ["ིྀ", 1], ["ྊ", 2], ["ྋ", 2], ["", 2], ["", 2], ["", 2], ["༚", 2], ["༝", 2], ["༛", 2], ["༞", 2], ["༛", 2], ["༜", 2], ["࿏", 2], ["", 2], ["", 2], ["", 2], ["", 2], ["", 2], ["࿐", 2], ["༻", 2], ["༻", 2], ["༇", 2]];
tibmachweb['9'] = [[" ", 2], ["", 2], ["༖", 2], ["༗", 2], ["༘", 2], ["༙", 2], ["༼", 2], ["༽", 2], ["", 2], ["", 2], ["", 2], ["", 2], ["་", 2], ["", 2], ["", 2], ["༠", 2], ["༡", 2], ["༢", 2], ["༣", 2], ["༤", 2], ["༥", 2], ["༦", 2], ["༧", 2], ["༨", 2], ["༩", 2], ["ཕ༹", 0], ["བ༹", 0], ["ཱོྀ", 1], ["࿄", 2], ["࿅", 2], ["࿆", 2], ["࿇", 2], ["࿈", 2], ["࿉", 2], ["࿊", 2], ["࿋", 2], ["࿌", 2], ["ཀ", 0], ["ཁ", 0], ["ག", 0], ["གྷ", 0], ["ང", 0], ["ཅ", 0], ["ཇ", 0], ["ཉ", 0], ["ཊ", 0], ["ཋ", 0], ["ཋ", 0], ["ཌ", 0], ["ཌྷ", 0], ["ཎ", 0], ["ཏ", 0], ["ཐ", 0], ["ད", 0], ["དྷ", 0], ["ན", 0], ["པ", 0], ["ཕ", 0], ["བ", 0], ["བྷ", 0], ["མ", 0], ["ཙ", 0], ["ཚ", 0], ["ཛ", 0], ["ཛྷ", 0], ["ཝ", 0], ["ཞ", 0], ["ཟ", 0], ["འ", 0], ["ཡ", 0], ["ཪ", 0], ["ལ", 0], ["ཤ", 0], ["ཥ", 0], ["ས", 0], ["ཧ", 0], ["ཨ", 0], ["ཀྵ", 0], ["", 0], ["", 0], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["ཱུ", 1], ["༕", 0], ["ཚ", 0], ["༿", 0]];
// fonttable structure:
// - table: the character table
// - vowel: if there should be a vowel put directly after the character, this vowel, 0 otherwise
// - index: the character index
// The getFontTable function takes the name of a font returned by InDesign and returns a table containing :
// - 0: the wylie table (example ededris['a'])
// - 1: the vowel to put after the wylie transliteration in the case of a (e)dedris font, or 0
// - 2: the character correspondance table
function getFontTable(fontname) {
switch (fontname.substring(0,1)){
case "D":
if (fontname.substring(0,6) == "Dedris") {
var vow = '';
var tmp = parseInt(fontname.substring(8,9));
if (tmp != 0 && !isNaN(tmp) && tmp != null) {
vow = vowels[tmp];
}
if (fontname.substring(7,8) == "v") {
return [ededrisvow, 0, ededrisCharcor];
}
return [ededris[fontname.substring(7,8)], vow, ededrisCharcor];
} else {
return null;
}
break;
case "E":
if (fontname.substring(0,7) == "Ededris") {
var vow = '';
var tmp = parseInt(fontname.substring(9,10));
if (tmp != 0 && !isNaN(tmp) && tmp != null) {
vow = vowels[tmp];
}
if (fontname.substring(8,9) == "v") {
return [ededrisvow, 0, ededrisCharcor];
}
return [ededris[fontname.substring(8,9)], vow, ededrisCharcor];
} else {
if (fontname.substring(0,4) == "Esam") {
return [esama[fontname.substring(4,5)], 0, esemaCharcor];
} else {
return null;
}
}
break;
case "T":
if (fontname.substring(0,17) == "TibetanMachineWeb" && ConvertTibetanMachineWeb == 1) {
var number = '0';
var tmp = parseInt(fontname.substring(17,18));
if (tmp != 0 && !isNaN(tmp) && tmp != null) {
number = tmp;
}
return [tibmachweb[number], 0, tibmachineCharcor];
}
if (fontname.substring(0,17) == "TibetanChogyalSkt") {
var number = '1';
var tmp = parseInt(fontname.substring(17,18));
if (tmp != 0 && !isNaN(tmp) && tmp != null) {
number = tmp;
}
return [tibchosgyalskt[number], 0, ChosgyalCharcor];
}
if (fontname.substring(0,14) == "TibetanChogyal") {
return [tibchosgyal[0], 0, ChosgyalCharcor];
}
if (fontname.substring(0,17) == "TibetanClassicSkt") {
var number = '1';
var tmp = parseInt(fontname.substring(17,18));
if (tmp != 0 && !isNaN(tmp) && tmp != null) {
number = tmp;
}
return [tibclassicskt[number], 0, ChosgyalCharcor];
}
if (fontname.substring(0,14) == "TibetanClassic") {
return [tibclassic[0], 0, ChosgyalCharcor];
}
break;
default:
return null;
break;
}
}
// this function takes a character (c) and a font name as returned by InDesign and
// returns the unicode -- plus the type of character (consonant, vowel, etc.), though unused
// as described in the comments of the font tables.
function ConvertChar(c, fname) {
if (c == '�') {
// This is how InDesign handles glyphs in the font that don't have any unicode value... In this case
// we output four zeros, in order to show that it needs inspection (haven't found yet how to convert properly)
return ["༠༠༠༠", 0];
}
if (fname.substring(0,16) == "Ededris-sym" || fname.substring(0,16) == "Dedris-syma") {
var cc = ededrisyma[c];
if (cc==null) {return c;} else {return cc;}
}
var f = getFontTable(fname);
if (f == null) {return c;}
var cc = f[2][c];
if (UniNameCharcor[c]=="XXX" || CS3Charcor[c]=="XXX") // see the comment on DISCRETIONARY_HYPHEN, far above
{
return ["༠༠༠༠", 0]; // instead of just outputing nothing, we output 4 zeros, to show that there is something that is to be inspected
}
if (cc == null) {
if (UniNameCharcor[c]) {
c = UniNameCharcor[c];
} else if (CS3Charcor[c]) {
c = CS3Charcor[c];
}
cc = f[2][c];
}
if (cc == null || f[0][cc] == null) {
return [c, 4];
}
if (f[1] == 0) {
return f[0][cc];
} else {
// the idea is that if a vowel is added, we consider the result to have a vowel
if (f[0][cc][1] == 0) {
return [f[0][cc][0]+f[1], 1];
} else {
return [f[0][cc][0]+f[1], f[0][cc][1]];
}
}
}
// this function was taken from the Adobe examples.
function FindandReplace(){
if (app.documents.length != 0){
if (app.selection.length == 1){
//Evaluate the selection based on its type.
switch (app.selection[0].constructor.name){
case "InsertionPoint":
case "Character":
case "Word":
case "TextStyleRange":
case "Line":
case "Paragraph":
case "TextColumn":
case "Text":
case "Story":
//The object is a text object; pass it on to a function.
myProcessText(app.selection[0]);
break;
//In addition to checking for the above text objects, we can
//also continue if the selection is a text frame selected with
//the Selection tool or the Direct Selection tool.
case "TextFrame":
//If the selection is a text frame, get a reference to the
//text in the text frame.
myProcessText(app.selection[0].texts.item(0));
break;
default:
alert("The selected object is not a text object. Select some text and try again.");
break;
}
}
else{
alert("Please select some text and try again.");
}
}
}
// The main function called with the selection as an argument, it replaces it with the
// wylie transliteration, in Times New Roman, replacing only characters in know fonts,
// to prevent transliteration of latine language text. This way you can select all
// your document and transcribe it.
function myProcessText(myTextObject){
var myDocument = app.documents.item(0);
// conver to World Ready Composer?
if (ConvertToWRC) {
try {
if (myTextObject.composer == "Adobe Paragraph Composer") {
myTextObject.composer = "Adobe World-Ready Paragraph Composer";
}
if (myTextObject.composer == "Adobe Single-line Composer") {
myTextObject.composer = "Adobe World-Ready Single-line Composer";
}
}
catch (_){}
}
var c;
var res = "";
var lastisa = 0; // to know if the last encountered consonant is a
for (var myCharCounter = 0; myCharCounter < myTextObject.characters.length; myCharCounter++) {
c = myTextObject.characters.item(myCharCounter);
// hack: we replace >ù in TibetanChogyal by a unicode OM
//alert(c.contents);
if((c.appliedFont.name.substring(0,14) == "TibetanChogyal"
|| c.appliedFont.name.substring(0,14) == "TibetanClassic")
&& c.appliedFont.name.substring(14,15) != "S"
&& c.contents == ">"
&& myCharCounter+1 < myTextObject.characters.length
&& myTextObject.characters.item(myCharCounter+1).contents == "ù") {
res+="ༀ";
myCharCounter = myCharCounter +1;
} else {
ct = ConvertChar(c.contents, c.appliedFont.name);
if (ct != 0 && ct != null){
res += ct[0];
}
}
}
if (res) {
var unifont = app.fonts.item(UniTibetanFont);
myTextObject.appliedFont = unifont;
if (!ComplexFontSizeCor && UniTibetanFontSize) {
myTextObject.pointSize = UniTibetanFontSize;
}
myTextObject.contents = res;
} else {
alert("Error: the script wasn't able to convert anything!");
exit();
}
if (!ComplexFontSizeCor) {return;}
// This part is experimental, and strangely doesn't work at all... maybe
for (var myCharCounter = 0; myCharCounter < myTextObject.characters.length; myCharCounter++) {
//for (var myCharCounter = 0; myCharCounter < res.length; myCharCounter++) {
// Now handling font size correspondances:
var fs = FontSizeCor[c.pointSize];
if (fs) {
// if it's a number, then we apply this font size
if (typeof fs === 'number') {
c.pointSize = fs;
} else {
fs = String(fs);
// else we consider it's a string, so we apply the character style corresponding to the string to it:
// (next code is from Adobe's examples)
try {
myCharacterStyle = myDocument.characterStyles.item(fs);
//If the style does not exist, trying to get its name will generate an error.
myName = myCharacterStyle.name;
}
catch (myError){
//The style did not exist, so create it.
myCharacterStyle = myDocument.characterStyles.add({name:fs});
}
c.appliedCharacterStyle = myCharacterStyle;
}
} else {
c.pointSize = UniTibetanFontSize;
}
}
}
function main(){
FindandReplace();
}
main();