1 static const int poses300[] = {
2     _Above,
3     _Above,
4     _Above,
5     _Above,
6     _Above,
7     _Above,
8     _Above,
9     _Above,
10     _Above,
11     _Above,
12     _Above,
13     _Above,
14     _Above,
15     _Above,
16     _Above,
17     _Above,
18     _Above,		/* 0x310 */
19     _Above,
20     _Above,
21     _Above,
22     _Above,
23     _Above|_CenterRight,
24     _Below,
25     _Below,
26     _Below,
27     _Below,
28     _Above,
29     _Above|_Right|_Touching,
30     _Below,
31     _Below,
32     _Below,
33     _Below,
34     _Below,		/* 0x320 */
35     _Below|_Touching,
36     _Below|_Touching,
37     _Below,
38     _Below,
39     _Below,
40     _Below,
41     _Below|_Touching,
42     _Below|_Touching,	/* 0x328 */
43     _Below,
44     _Below,
45     _Below,
46     _Below,
47     _Below,
48     _Below,
49     _Below,
50     _Below,		/* 0x330 */
51     _Below,
52     _Below,
53     _Below,
54     _Overstrike,
55     _Overstrike,
56     _Overstrike,
57     _Overstrike,
58     _Overstrike,	/* 0x338 */
59     _Below,
60     _Below,
61     _Below,
62     _Below,
63     _Above,
64     _Above,
65     _Above,
66     _Above|_Left,	/* 0x340 */
67     _Above|_Right,
68     _Above,
69     _Above,
70     _Above,
71     _Below,
72     0
73 };
74 static const int poses360[] = {
75     _Above|_Joins2,
76     _Above|_Joins2,
77     _Below|_Joins2,
78     0
79 };
80 static const int poses385[] = {
81     _Above
82 };
83 static const int poses483[] = {
84     _Above|_CenterLeft,
85     _Above|_CenterLeft,
86     _Above|_CenterLeft,
87     _Above|_CenterLeft,
88     0
89 };
90 
91 static const int poses488[] = {
92     _CenteredOutside,				/* 8 down half-circles distributed in a circle around the character */
93     _CenteredOutside				/* 8 commas rotated as moved around circle, bottom is normal comma */
94 };
95 
96 static const int poses591[] = {
97     _Below,
98     _Above,
99     _Above,
100     _Above,
101     _Above,
102     _Below|_CenterRight,
103     _Above,
104     _Above,
105     _Above|_LeftEdge,
106     _Below|_RightEdge,
107     _Below,
108     _Above|_CenterRight,
109     _Above|_RightEdge,
110     _Above|_CenterRight,
111     _Above,
112     _Above|_RightEdge,			/* 05a0 */
113     _Above|_LeftEdge
114 };
115 
116 static const int poses5A3[] = {
117     _Below,
118     _Below,
119     _Below|_CenterLeft,
120     _Below|_CenterLeft,
121     _Below,
122     _Above|_CenterLeft,
123     _Above|_LeftEdge,
124     _Below,
125     _Above,
126     _Above,
127     _Below|_RightEdge,
128     _Above|_LeftEdge,
129     _Above,
130     _Below,				/* 05b0 */
131     _Below,
132     _Below,
133     _Below,
134     _Below,
135     _Below,
136     _Below,
137     _Below,
138     _Below,
139     _Above|_LeftEdge
140 };
141 
142 static const int poses5BB[] = {
143     _Below,
144     _Overstrike,
145     _Below
146 };
147 
148 static const int poses5BF[] = {
149     _Above
150 };
151 
152 static const int poses5C1[] = {
153     _Above|_RightEdge,
154     _Above|_LeftEdge
155 };
156 
157 static const int poses5C4[] = {
158     _Above
159 };
160 
161 static const int poses64b[] = {
162     _Above,
163     _Above,
164     _Below,
165     _Above,
166     _Above,
167     _Below,
168     _Above,
169     _Above,
170     0
171 };
172 
173 static const int poses670[] = {
174     _Above
175 };
176 
177 static const int poses6D6[] = {
178     _Above,
179     _Above,
180     _Above,
181     _Above,
182     _Above,
183     _Above,
184     _Above,
185     _Overstrike,
186     _Overstrike,
187     _Above,
188     _Above,		/* 6e0 */
189     _Above,
190     _Above,
191     _Below,
192     _Above
193 };
194 
195 static const int poses6E7[] = {
196     _Above,
197     _Above
198 };
199 
200 static const int poses6EA[] = {
201     _Below,
202     _Above,
203     _Above,
204     _Below
205 };
206 
207 static const int poses711[] = {
208     _Above
209 };
210 
211 static const int poses730[] = {
212     _Above,
213     _Below,
214     _CenteredOutside,		/* Two dots, one above CenterRight, one below CenterLeft */
215     _Above,
216     _Below,
217     _Above,
218     _Above,
219     _Below,
220     _Below,
221     _Below,
222     _Above,
223     _Below,
224     _Below,
225     _Above,
226     _Below,
227     _Above,
228     _Above|_LeftEdge,	/* 0740 */
229     _Above,
230     _Below,
231     _Above,
232     _Below,
233     _Above,
234     _Below,
235     _Above,
236     _Below,
237     _Above,
238     _Above
239 };
240 
241 static const int poses7A6[] = {
242     _Above|_CenterLeft,
243     _Above|_CenterLeft,
244     _Below|_CenterLeft,
245     _Below|_CenterLeft,
246     _Above|_CenterLeft,
247     _Above|_CenterLeft,
248     _Above|_CenterLeft,
249     _Above|_CenterLeft,
250     _Above|_CenterLeft,
251     _Above|_CenterLeft,
252     _Above|_CenterLeft,
253 };
254 
255 static const int poses901[] = {
256     _Above,
257     _Above,
258     _Right
259 };
260 
261 static const int poses93C[] = {
262     _Below
263 };
264 
265 static const int poses93E[] = {
266     _Right,
267     _Left,
268     _Right,	/* 940 */
269     _Below,
270     _Below,
271     _Below,
272     _Below,
273     _Above,
274     _Above|_CenterLeft,
275     _Above|_CenterLeft,
276     _Above|_CenterLeft,
277     _Right,
278     _Right,
279     _Right,
280     _Right,
281     _Below|_CenterRight
282 };
283 
284 static const int poses951[] = {
285     _Above,
286     _Below,
287     _Above,
288     _Above
289 };
290 
291 static const int poses962[] = {
292     _Below,
293     _Below
294 };
295 
296 static const int poses981[] = {
297     _Above,
298     _Right,
299     _Right
300 };
301 
302 static const int poses9BC[] = {
303     _Below
304 };
305 
306 static const int poses9BE[] = {
307     _Right,
308     _Left,
309     _Right,
310     _Below,
311     _Below,
312     _Below,
313     _Below|_CenterRight
314 };
315 
316 static const int poses9C7[] = {
317     _Left,
318     _Left
319 };
320 
321 static const int poses9CB[] = {
322     _Overstrike,
323     _Overstrike,
324     _Below
325 };
326 
327 static const int poses9D7[] = {
328     _Right
329 };
330 
331 static const int poses9E2[] = {
332     _Below,
333     _Below
334 };
335 
336 static const int posesA02[] = {
337     _Above
338 };
339 
340 static const int posesA3C[] = {
341     _Below
342 };
343 
344 static const int posesA3E[] = {
345     _Right,
346     _Left,
347     _Right,		/* 0a40 */
348     _Below,
349     _Below
350 };
351 
352 static const int posesA47[] = {
353     _Above|_CenterLeft,
354     _Above|_CenterLeft
355 };
356 
357 static const int posesA4B[] = {
358     _Above|_CenterLeft,
359     _Above|_CenterLeft,
360     _Below
361 };
362 
363 static const int posesA70[] = {
364     _Above,
365     _Above
366 };
367 
368 static const int posesA81[] = {
369     _Above,
370     _Above,
371     _Right
372 };
373 
374 static const int posesABC[] = {
375     _Below
376 };
377 
378 static const int posesABE[] = {
379     _Right,
380     _Left,
381     _Right,
382     _Below,
383     _Below,
384     _Below,
385     _Below,
386     _Above
387 };
388 
389 static const int posesAC7[] = {
390     _Above|_CenterLeft,
391     _Above|_CenterLeft,
392     _Right
393 };
394 
395 static const int posesACB[] = {
396     _Right,
397     _Right,
398     _Below|_CenterRight
399 };
400 
401 static const int posesB01[] = {
402     _Above,
403     _Above,
404     _Right
405 };
406 
407 static const int posesB3C[] = {
408     _Below
409 };
410 
411 static const int posesB3E[] = {
412     _Right,
413     _Above,
414     _Right,		/* 0b40 */
415     _Below,
416     _Below,
417     _Below
418 };
419 
420 static const int posesB47[] = {
421     _Left,
422     _Outside|_Left|_Above
423 };
424 
425 static const int posesB4B[] = {
426     _CenteredOutside,
427     _CenteredOutside,
428     _Below
429 };
430 
431 static const int posesB56[] = {
432     _Above,
433     _Right,
434 };
435 
436 static const int posesB82[] = {
437     _Above,
438     _Right
439 };
440 
441 static const int posesBBE[] = {
442     _Right,
443     _Right,
444     _Above,
445     _Right,
446     _Right
447 };
448 
449 static const int posesBC6[] = {
450     _Left,
451     _Left,
452     _Left
453 };
454 
455 static const int posesBCA[] = {
456     _CenteredOutside,
457     _CenteredOutside,
458     _CenteredOutside,
459     _Above
460 };
461 
462 static const int posesBD7[] = {
463     _Right
464 };
465 
466 static const int posesC01[] = {
467     _Right,
468     _Right,
469     _Right
470 };
471 
472 static const int posesC3E[] = {
473     _Above|_CenterRight,
474     _Above,
475     _Above,
476     _Right,
477     _Right,
478     _Right,
479     _Right
480 };
481 
482 static const int posesC46[] = {
483     _Above,
484     _Above,
485     _CenteredOutside
486 };
487 
488 static const int posesC4A[] = {
489     _Above,
490     _Above,
491     _Above,
492     _Above
493 };
494 
495 static const int posesC55[] = {
496     _Above,
497     _Below
498 };
499 
500 static const int posesC82[] = {
501     _Right,
502     _Right
503 };
504 
505 static const int posesCBE[] = {
506     _Right,
507     _Above,
508     _Outside|_Above|_Right,
509     _Right,
510     _Right,
511     _Right,
512     _Right
513 };
514 
515 static const int posesCC6[] = {
516     _Above,
517     _Outside|_Above|_Right,
518     _Outside|_Above|_Right
519 };
520 
521 static const int posesCCA[] = {
522     _Outside|_Above|_Right,
523     _Outside|_Above|_Right,
524     _Above,
525     _Above
526 };
527 
528 static const int posesCD5[] = {
529     _Right,
530     _Right
531 };
532 
533 static const int posesD02[] = {
534     _Right,
535     _Right
536 };
537 
538 static const int posesD3E[] = {
539     _Right,
540     _Right,
541     _Right,
542     _Below|_Right,
543     _Below|_Right,
544     _Below
545 };
546 
547 static const int posesD46[] = {
548     _Left,
549     _Left,
550     _Left
551 };
552 
553 static const int posesD4A[] = {
554     _Outside|_Left|_Right,
555     _Outside|_Left|_Right,
556     _Outside|_Left|_Right,
557     _Above|_Right
558 };
559 
560 static const int posesD57[] = {
561     _Right
562 };
563 
564 static const int posesD82[] = {
565     _Right,
566     _Right
567 };
568 
569 static const int posesDCA[] = {
570     _Right
571 };
572 
573 static const int posesDCF[] = {
574     _Right,
575     _Right,
576     _Right,
577     _Above,
578     _Above,
579     _Below
580 };
581 
582 static const int posesDD6[] = {
583     _Below
584 };
585 
586 static const int posesDD8[] = {
587     _Right,
588     _Left,
589     _CenteredOutside,
590     _Left,
591     _CenteredOutside,
592     _CenteredOutside,
593     _CenteredOutside,
594     _Right
595 };
596 
597 static const int posesDF2[] = {
598     _Right,
599     _Right
600 };
601 
602 static const int posesE31[] = {
603     _Above
604 };
605 
606 static const int posesE34[] = {
607     _Above,
608     _Above,
609     _Above,
610     _Above,
611     _Below|_Right,
612     _Below|_CenterRight,
613     _Below|_Right
614 };
615 
616 static const int posesE47[] = {
617     _Above,
618     _Above|_Right,
619     _Above,
620     _Above,
621     _Above|_CenterRight,
622     _Above,
623     _Above|_Right,
624     _Above|_Right,
625 };
626 
627 static const int posesEB1[] = {
628     _Above
629 };
630 
631 static const int posesEB4[] = {
632     _Above,
633     _Above,
634     _Above,
635     _Above,
636     _Below,
637     _Below
638 };
639 
640 static const int posesEBB[] = {
641     _Above,
642     _Below
643 };
644 
645 static const int posesEC8[] = {
646     _Above,
647     _Above,
648     _Above,
649     _Above,
650     _Above,
651     _Above
652 };
653 
654 static const int posesF18[] = {
655     _Below|_Right
656 };
657 
658 static const int posesF35[] = {
659     _Below
660 };
661 
662 static const int posesF37[] = {
663     _Below
664 };
665 
666 static const int posesF39[] = {
667     _Above|_Right|_Touching
668 };
669 
670 static const int posesF3E[] = {
671     _Below|_Right,
672     _Below|_Left
673 };
674 
675 static const int posesF71[] = {
676     _Below,
677     _Above,
678     _Outside|_Above|_Below,
679     _Below,
680     _Below,
681     _Outside|_Above|_Below,
682     _Outside|_Above|_Below,
683     _Outside|_Above|_Below,
684     _Outside|_Above|_Below,
685     _Above|_CenterLeft,
686     _Above|_CenterLeft,
687     _Above,
688     _Above,
689     _Above,
690     _Right,
691     _Above,		/* 0f80 */
692     _Outside|_Above|_Below,
693     _Above,
694     _Above,
695     _Below|_Left
696 };
697 
698 static const int posesF86[] = {
699     _Above,
700     _Above,
701     _Above,
702     _Above,
703     _Above,
704     _Above
705 };
706 
707 static const int posesF90[] = {
708     _Below,
709     _Below,
710     _Below,
711     _Below,
712     _Below,
713     _Below,
714     _Below,
715     _Below
716 };
717 
718 static const int posesF99[] = {
719     _Below,
720     _Below,
721     _Below,
722     _Below,
723     _Below,
724     _Below,
725     _Below,
726     _Below,
727     _Below,
728     _Below,
729     _Below,
730     _Below,
731     _Below,
732     _Below,
733     _Below,
734     _Below,
735     _Below,
736     _Below,
737     _Below,
738     _Below,
739     _Below,
740     _Below,
741     _Below,
742     _Below,
743     _Below,
744     _Below,
745     _Below,
746     _Below,
747     _Below,
748     _Below,
749     _Below,
750     _Below,
751     _Below,
752     _Below,
753     _Below,
754     _Below
755 };
756 
757 static const int posesFC6[] = {
758     _Below
759 };
760 
761 static const int poses102C[] = {
762     _Right,
763     _Above,
764     _Above,
765     _Below,
766     _Below,			/* 1030 */
767     _Left,
768     _Above
769 };
770 
771 static const int poses1036[] = {
772     _Above,
773     _Below,
774     _Right,
775     _Above
776 };
777 
778 static const int poses1056[] = {
779     _Right,
780     _Right,
781     _Below,
782     _Below
783 };
784 
785 static const int poses17B4[] = {
786     _Overstrike,
787     _Overstrike,
788     _Right,
789     _Above,
790     _Above,
791     _Above,
792     _Above,
793     _Below,
794     _Below,
795     _Below,
796     _Outside|_Left|_Above,
797     _CenteredOutside,
798     _CenteredOutside,		/* 17c0 */
799     _Left,
800     _Left,
801     _Left,
802     _CenteredOutside,
803     _CenteredOutside,
804     _Above,
805     _Right,
806     _Right,
807     _Above,
808     _Above,
809     _Above,
810     _Above,
811     _Above|_CenterRight,
812     _Above|_CenterRight,
813     _Above,
814     _Above|_CenterRight,	/* 17d0 */
815     _Above,
816     _Below,
817     _Above
818 };
819 
820 static const int poses18A9[] = {
821     _Above|_Left
822 };
823 
824 static const int poses1FBD[] = {	/* These aren't listed as combiners, but if we don't use them as such greek fonts don't work */
825     _Above,
826     _Right,
827     _Above,
828     _Above,
829     _Above
830 };
831 
832 static const int poses1FCD[] = {	/* These aren't listed as combiners, but if we don't use them as such greek fonts don't work */
833     _Above,
834     _Above,
835     _Above
836 };
837 
838 static const int poses1FDD[] = {	/* These aren't listed as combiners, but if we don't use them as such greek fonts don't work */
839     _Above,
840     _Above,
841     _Above
842 };
843 
844 static const int poses1FED[] = {	/* These aren't listed as combiners, but if we don't use them as such greek fonts don't work */
845     _Above,
846     _Above,
847     _Above
848 };
849 
850 static const int poses1FFD[] = {	/* These aren't listed as combiners, but if we don't use them as such greek fonts don't work */
851     _Above,
852     _Above
853 };
854 
855 static const int poses20D0[] = {
856     _Above,
857     _Above,
858     _Overstrike,
859     _Overstrike,
860     _Above,
861     _Above,
862     _Above,
863     _Above,
864     _Overstrike,
865     _Overstrike,
866     _Overstrike,
867     _Above,
868     _Above,
869     _CenteredOutside,
870     _CenteredOutside,
871     _CenteredOutside,
872     _Overstrike,
873     _Above,
874     _CenteredOutside,
875     _CenteredOutside
876 };
877 
878 static const int poses302A[] = {
879     _Below|_Left,
880     _Above|_Left,
881     _Above|_Right,
882     _Below|_Right,
883     _Left,
884     _Left
885 };
886 
887 static const int poses3099[] = {
888     _Above|_Right,
889     _Above|_Right,
890 };
891 
892 static const int posesFB1E[] = {
893     _Above
894 };
895 
896 static const int posesFE20[] = {
897     _Above,
898     _Above,
899     _Above,
900     _Above
901 };
902 
903 const static struct {
904     int low, high;
905     const int *pos;
906 } combiners[] = {
907     { 0x300, 0x345, poses300 },
908     { 0x360, 0x362, poses360 },
909     { 0x385, 0x385, poses385 },
910     { 0x483, 0x486, poses483 },
911     { 0x488, 0x489, poses488 },
912     { 0x591, 0x5A1, poses591 },
913     { 0x5A3, 0x5B9, poses5A3 },
914     { 0x5BB, 0x5BD, poses5BB },
915     { 0x5BF, 0x5BF, poses5BF },
916     { 0x5C1, 0x5C2, poses5C1 },
917     { 0x5C4, 0x5C4, poses5C4 },
918     { 0x64b, 0x655, poses64b },
919     { 0x670, 0x670, poses670 },
920     { 0x6D6, 0x6E4, poses6D6 },
921     { 0x6E7, 0x6E8, poses6E7 },
922     { 0x6EA, 0x6ED, poses6EA },
923     { 0x711, 0x711, poses711 },
924     { 0x730, 0x74A, poses730 },
925     { 0x7A6, 0x7B0, poses7A6 },
926     { 0x901, 0x903, poses901 },
927     { 0x93C, 0x93C, poses93C },
928     { 0x93E, 0x94D, poses93E },
929     { 0x951, 0x954, poses951 },
930     { 0x962, 0x963, poses962 },
931     { 0x981, 0x983, poses981 },
932     { 0x9BC, 0x9BC, poses9BC },
933     { 0x9BE, 0x9C4, poses9BE },
934     { 0x9C7, 0x9C8, poses9C7 },
935     { 0x9CB, 0x9CD, poses9CB },
936     { 0x9D7, 0x9D7, poses9D7 },
937     { 0x9E2, 0x9E3, poses9E2 },
938     { 0xA02, 0xA02, posesA02 },
939     { 0xA3C, 0xA3C, posesA3C },
940     { 0xA3E, 0xA42, posesA3E },
941     { 0xA47, 0xA48, posesA47 },
942     { 0xA4B, 0xA4D, posesA4B },
943     { 0xA70, 0xA71, posesA70 },
944     { 0xA81, 0xA83, posesA81 },
945     { 0xABC, 0xABC, posesABC },
946     { 0xABE, 0xAC5, posesABE },
947     { 0xAC7, 0xAC9, posesAC7 },
948     { 0xACB, 0xACD, posesACB },
949     { 0xB01, 0xB03, posesB01 },
950     { 0xB3C, 0xB3C, posesB3C },
951     { 0xB3E, 0xB43, posesB3E },
952     { 0xB47, 0xB48, posesB47 },
953     { 0xB4B, 0xB4D, posesB4B },
954     { 0xB56, 0xB56, posesB56 },
955     { 0xB82, 0xB83, posesB82 },
956     { 0xBBE, 0xBC2, posesBBE },
957     { 0xBC6, 0xBC8, posesBC6 },
958     { 0xBCA, 0xBCD, posesBCA },
959     { 0xBD7, 0xBD7, posesBD7 },
960     { 0xC01, 0xC03, posesC01 },
961     { 0xC3E, 0xC44, posesC3E },
962     { 0xC46, 0xC48, posesC46 },
963     { 0xC4A, 0xC4D, posesC4A },
964     { 0xC55, 0xC56, posesC55 },
965     { 0xC82, 0xC83, posesC82 },
966     { 0xCBE, 0xCC4, posesCBE },
967     { 0xCC6, 0xCC8, posesCC6 },
968     { 0xCCA, 0xCCD, posesCCA },
969     { 0xCD5, 0xCD6, posesCD5 },
970     { 0xD02, 0xD03, posesD02 },
971     { 0xD3E, 0xD43, posesD3E },
972     { 0xD46, 0xD48, posesD46 },
973     { 0xD4A, 0xD4D, posesD4A },
974     { 0xD57, 0xD57, posesD57 },
975     { 0xD82, 0xD83, posesD82 },
976     { 0xDCA, 0xDCA, posesDCA },
977     { 0xDCF, 0xDD4, posesDCF },
978     { 0xDD6, 0xDD6, posesDD6 },
979     { 0xDD8, 0xDDF, posesDD8 },
980     { 0xDF2, 0xDF3, posesDF2 },
981     { 0xE31, 0xE31, posesE31 },
982     { 0xE34, 0xE3A, posesE34 },
983     { 0xE47, 0xE4e, posesE47 },
984     { 0xEB1, 0xEB1, posesEB1 },
985     { 0xEB4, 0xEB9, posesEB4 },
986     { 0xEBB, 0xEBC, posesEBB },
987     { 0xEC8, 0xECD, posesEC8 },
988     { 0xF18, 0xF19, posesF18 },
989     { 0xF35, 0xF35, posesF35 },
990     { 0xF37, 0xF37, posesF37 },
991     { 0xF39, 0xF39, posesF39 },
992     { 0xF3E, 0xF3F, posesF3E },
993     { 0xF71, 0xF84, posesF71 },
994     { 0xF86, 0xF87, posesF86 },
995     { 0xF90, 0xF97, posesF90 },
996     { 0xF99, 0xFBC, posesF99 },
997     { 0xFC6, 0xFC6, posesFC6 },
998     { 0x102c, 0x1032, poses102C },
999     { 0x1036, 0x1039, poses1036 },
1000     { 0x1056, 0x1059, poses1056 },
1001     { 0x17B4, 0x17D3, poses17B4 },
1002     { 0x18A9, 0x18A9, poses18A9 },
1003     { 0x1FBD, 0x1FC2, poses1FBD },
1004     { 0x1FCD, 0x1FCF, poses1FCD },
1005     { 0x1FDD, 0x1FDF, poses1FDD },
1006     { 0x1FED, 0x1FEF, poses1FED },
1007     { 0x1FFD, 0x1FFE, poses1FFD },
1008     { 0x20D0, 0x20E3, poses20D0 },
1009     { 0x302A, 0x302F, poses302A },
1010     { 0x3099, 0x309A, poses3099 },
1011     { 0xFB1E, 0xFB1E, posesFB1E },
1012     { 0xFE20, 0xFB23, posesFE20 },
1013     { 0 }
1014 };
1015