Debian Codegraph @

libs/xpdf/xpdf-src/fofi/FoFiEncodings.cc

raw
1 //========================================================================
2 //
3 // FoFiEncodings.cc
4 //
5 // Copyright 1999-2003 Glyph & Cog, LLC
6 //
7 //========================================================================
8
9 #include <aconf.h>
10
11 #include <stdlib.h>
12 #include "gmempp.h"
13 #include "FoFiEncodings.h"
14
15 //------------------------------------------------------------------------
16 // Type 1 and 1C font data
17 //------------------------------------------------------------------------
18
19 const char *fofiType1StandardEncoding[256] = {
20 NULL,
21 NULL,
22 NULL,
23 NULL,
24 NULL,
25 NULL,
26 NULL,
27 NULL,
28 NULL,
29 NULL,
30 NULL,
31 NULL,
32 NULL,
33 NULL,
34 NULL,
35 NULL,
36 NULL,
37 NULL,
38 NULL,
39 NULL,
40 NULL,
41 NULL,
42 NULL,
43 NULL,
44 NULL,
45 NULL,
46 NULL,
47 NULL,
48 NULL,
49 NULL,
50 NULL,
51 NULL,
52 "space",
53 "exclam",
54 "quotedbl",
55 "numbersign",
56 "dollar",
57 "percent",
58 "ampersand",
59 "quoteright",
60 "parenleft",
61 "parenright",
62 "asterisk",
63 "plus",
64 "comma",
65 "hyphen",
66 "period",
67 "slash",
68 "zero",
69 "one",
70 "two",
71 "three",
72 "four",
73 "five",
74 "six",
75 "seven",
76 "eight",
77 "nine",
78 "colon",
79 "semicolon",
80 "less",
81 "equal",
82 "greater",
83 "question",
84 "at",
85 "A",
86 "B",
87 "C",
88 "D",
89 "E",
90 "F",
91 "G",
92 "H",
93 "I",
94 "J",
95 "K",
96 "L",
97 "M",
98 "N",
99 "O",
100 "P",
101 "Q",
102 "R",
103 "S",
104 "T",
105 "U",
106 "V",
107 "W",
108 "X",
109 "Y",
110 "Z",
111 "bracketleft",
112 "backslash",
113 "bracketright",
114 "asciicircum",
115 "underscore",
116 "quoteleft",
117 "a",
118 "b",
119 "c",
120 "d",
121 "e",
122 "f",
123 "g",
124 "h",
125 "i",
126 "j",
127 "k",
128 "l",
129 "m",
130 "n",
131 "o",
132 "p",
133 "q",
134 "r",
135 "s",
136 "t",
137 "u",
138 "v",
139 "w",
140 "x",
141 "y",
142 "z",
143 "braceleft",
144 "bar",
145 "braceright",
146 "asciitilde",
147 NULL,
148 NULL,
149 NULL,
150 NULL,
151 NULL,
152 NULL,
153 NULL,
154 NULL,
155 NULL,
156 NULL,
157 NULL,
158 NULL,
159 NULL,
160 NULL,
161 NULL,
162 NULL,
163 NULL,
164 NULL,
165 NULL,
166 NULL,
167 NULL,
168 NULL,
169 NULL,
170 NULL,
171 NULL,
172 NULL,
173 NULL,
174 NULL,
175 NULL,
176 NULL,
177 NULL,
178 NULL,
179 NULL,
180 NULL,
181 "exclamdown",
182 "cent",
183 "sterling",
184 "fraction",
185 "yen",
186 "florin",
187 "section",
188 "currency",
189 "quotesingle",
190 "quotedblleft",
191 "guillemotleft",
192 "guilsinglleft",
193 "guilsinglright",
194 "fi",
195 "fl",
196 NULL,
197 "endash",
198 "dagger",
199 "daggerdbl",
200 "periodcentered",
201 NULL,
202 "paragraph",
203 "bullet",
204 "quotesinglbase",
205 "quotedblbase",
206 "quotedblright",
207 "guillemotright",
208 "ellipsis",
209 "perthousand",
210 NULL,
211 "questiondown",
212 NULL,
213 "grave",
214 "acute",
215 "circumflex",
216 "tilde",
217 "macron",
218 "breve",
219 "dotaccent",
220 "dieresis",
221 NULL,
222 "ring",
223 "cedilla",
224 NULL,
225 "hungarumlaut",
226 "ogonek",
227 "caron",
228 "emdash",
229 NULL,
230 NULL,
231 NULL,
232 NULL,
233 NULL,
234 NULL,
235 NULL,
236 NULL,
237 NULL,
238 NULL,
239 NULL,
240 NULL,
241 NULL,
242 NULL,
243 NULL,
244 NULL,
245 "AE",
246 NULL,
247 "ordfeminine",
248 NULL,
249 NULL,
250 NULL,
251 NULL,
252 "Lslash",
253 "Oslash",
254 "OE",
255 "ordmasculine",
256 NULL,
257 NULL,
258 NULL,
259 NULL,
260 NULL,
261 "ae",
262 NULL,
263 NULL,
264 NULL,
265 "dotlessi",
266 NULL,
267 NULL,
268 "lslash",
269 "oslash",
270 "oe",
271 "germandbls",
272 NULL,
273 NULL,
274 NULL,
275 NULL
276 };
277
278 const char *fofiType1ExpertEncoding[256] = {
279 NULL,
280 NULL,
281 NULL,
282 NULL,
283 NULL,
284 NULL,
285 NULL,
286 NULL,
287 NULL,
288 NULL,
289 NULL,
290 NULL,
291 NULL,
292 NULL,
293 NULL,
294 NULL,
295 NULL,
296 NULL,
297 NULL,
298 NULL,
299 NULL,
300 NULL,
301 NULL,
302 NULL,
303 NULL,
304 NULL,
305 NULL,
306 NULL,
307 NULL,
308 NULL,
309 NULL,
310 NULL,
311 "space",
312 "exclamsmall",
313 "Hungarumlautsmall",
314 NULL,
315 "dollaroldstyle",
316 "dollarsuperior",
317 "ampersandsmall",
318 "Acutesmall",
319 "parenleftsuperior",
320 "parenrightsuperior",
321 "twodotenleader",
322 "onedotenleader",
323 "comma",
324 "hyphen",
325 "period",
326 "fraction",
327 "zerooldstyle",
328 "oneoldstyle",
329 "twooldstyle",
330 "threeoldstyle",
331 "fouroldstyle",
332 "fiveoldstyle",
333 "sixoldstyle",
334 "sevenoldstyle",
335 "eightoldstyle",
336 "nineoldstyle",
337 "colon",
338 "semicolon",
339 "commasuperior",
340 "threequartersemdash",
341 "periodsuperior",
342 "questionsmall",
343 NULL,
344 "asuperior",
345 "bsuperior",
346 "centsuperior",
347 "dsuperior",
348 "esuperior",
349 NULL,
350 NULL,
351 NULL,
352 "isuperior",
353 NULL,
354 NULL,
355 "lsuperior",
356 "msuperior",
357 "nsuperior",
358 "osuperior",
359 NULL,
360 NULL,
361 "rsuperior",
362 "ssuperior",
363 "tsuperior",
364 NULL,
365 "ff",
366 "fi",
367 "fl",
368 "ffi",
369 "ffl",
370 "parenleftinferior",
371 NULL,
372 "parenrightinferior",
373 "Circumflexsmall",
374 "hyphensuperior",
375 "Gravesmall",
376 "Asmall",
377 "Bsmall",
378 "Csmall",
379 "Dsmall",
380 "Esmall",
381 "Fsmall",
382 "Gsmall",
383 "Hsmall",
384 "Ismall",
385 "Jsmall",
386 "Ksmall",
387 "Lsmall",
388 "Msmall",
389 "Nsmall",
390 "Osmall",
391 "Psmall",
392 "Qsmall",
393 "Rsmall",
394 "Ssmall",
395 "Tsmall",
396 "Usmall",
397 "Vsmall",
398 "Wsmall",
399 "Xsmall",
400 "Ysmall",
401 "Zsmall",
402 "colonmonetary",
403 "onefitted",
404 "rupiah",
405 "Tildesmall",
406 NULL,
407 NULL,
408 NULL,
409 NULL,
410 NULL,
411 NULL,
412 NULL,
413 NULL,
414 NULL,
415 NULL,
416 NULL,
417 NULL,
418 NULL,
419 NULL,
420 NULL,
421 NULL,
422 NULL,
423 NULL,
424 NULL,
425 NULL,
426 NULL,
427 NULL,
428 NULL,
429 NULL,
430 NULL,
431 NULL,
432 NULL,
433 NULL,
434 NULL,
435 NULL,
436 NULL,
437 NULL,
438 NULL,
439 NULL,
440 "exclamdownsmall",
441 "centoldstyle",
442 "Lslashsmall",
443 NULL,
444 NULL,
445 "Scaronsmall",
446 "Zcaronsmall",
447 "Dieresissmall",
448 "Brevesmall",
449 "Caronsmall",
450 NULL,
451 "Dotaccentsmall",
452 NULL,
453 NULL,
454 "Macronsmall",
455 NULL,
456 NULL,
457 "figuredash",
458 "hypheninferior",
459 NULL,
460 NULL,
461 "Ogoneksmall",
462 "Ringsmall",
463 "Cedillasmall",
464 NULL,
465 NULL,
466 NULL,
467 "onequarter",
468 "onehalf",
469 "threequarters",
470 "questiondownsmall",
471 "oneeighth",
472 "threeeighths",
473 "fiveeighths",
474 "seveneighths",
475 "onethird",
476 "twothirds",
477 NULL,
478 NULL,
479 "zerosuperior",
480 "onesuperior",
481 "twosuperior",
482 "threesuperior",
483 "foursuperior",
484 "fivesuperior",
485 "sixsuperior",
486 "sevensuperior",
487 "eightsuperior",
488 "ninesuperior",
489 "zeroinferior",
490 "oneinferior",
491 "twoinferior",
492 "threeinferior",
493 "fourinferior",
494 "fiveinferior",
495 "sixinferior",
496 "seveninferior",
497 "eightinferior",
498 "nineinferior",
499 "centinferior",
500 "dollarinferior",
501 "periodinferior",
502 "commainferior",
503 "Agravesmall",
504 "Aacutesmall",
505 "Acircumflexsmall",
506 "Atildesmall",
507 "Adieresissmall",
508 "Aringsmall",
509 "AEsmall",
510 "Ccedillasmall",
511 "Egravesmall",
512 "Eacutesmall",
513 "Ecircumflexsmall",
514 "Edieresissmall",
515 "Igravesmall",
516 "Iacutesmall",
517 "Icircumflexsmall",
518 "Idieresissmall",
519 "Ethsmall",
520 "Ntildesmall",
521 "Ogravesmall",
522 "Oacutesmall",
523 "Ocircumflexsmall",
524 "Otildesmall",
525 "Odieresissmall",
526 "OEsmall",
527 "Oslashsmall",
528 "Ugravesmall",
529 "Uacutesmall",
530 "Ucircumflexsmall",
531 "Udieresissmall",
532 "Yacutesmall",
533 "Thornsmall",
534 "Ydieresissmall"
535 };
536
537 //------------------------------------------------------------------------
538 // Type 1C font data
539 //------------------------------------------------------------------------
540
541 const char *fofiType1CStdStrings[391] = {
542 ".notdef",
543 "space",
544 "exclam",
545 "quotedbl",
546 "numbersign",
547 "dollar",
548 "percent",
549 "ampersand",
550 "quoteright",
551 "parenleft",
552 "parenright",
553 "asterisk",
554 "plus",
555 "comma",
556 "hyphen",
557 "period",
558 "slash",
559 "zero",
560 "one",
561 "two",
562 "three",
563 "four",
564 "five",
565 "six",
566 "seven",
567 "eight",
568 "nine",
569 "colon",
570 "semicolon",
571 "less",
572 "equal",
573 "greater",
574 "question",
575 "at",
576 "A",
577 "B",
578 "C",
579 "D",
580 "E",
581 "F",
582 "G",
583 "H",
584 "I",
585 "J",
586 "K",
587 "L",
588 "M",
589 "N",
590 "O",
591 "P",
592 "Q",
593 "R",
594 "S",
595 "T",
596 "U",
597 "V",
598 "W",
599 "X",
600 "Y",
601 "Z",
602 "bracketleft",
603 "backslash",
604 "bracketright",
605 "asciicircum",
606 "underscore",
607 "quoteleft",
608 "a",
609 "b",
610 "c",
611 "d",
612 "e",
613 "f",
614 "g",
615 "h",
616 "i",
617 "j",
618 "k",
619 "l",
620 "m",
621 "n",
622 "o",
623 "p",
624 "q",
625 "r",
626 "s",
627 "t",
628 "u",
629 "v",
630 "w",
631 "x",
632 "y",
633 "z",
634 "braceleft",
635 "bar",
636 "braceright",
637 "asciitilde",
638 "exclamdown",
639 "cent",
640 "sterling",
641 "fraction",
642 "yen",
643 "florin",
644 "section",
645 "currency",
646 "quotesingle",
647 "quotedblleft",
648 "guillemotleft",
649 "guilsinglleft",
650 "guilsinglright",
651 "fi",
652 "fl",
653 "endash",
654 "dagger",
655 "daggerdbl",
656 "periodcentered",
657 "paragraph",
658 "bullet",
659 "quotesinglbase",
660 "quotedblbase",
661 "quotedblright",
662 "guillemotright",
663 "ellipsis",
664 "perthousand",
665 "questiondown",
666 "grave",
667 "acute",
668 "circumflex",
669 "tilde",
670 "macron",
671 "breve",
672 "dotaccent",
673 "dieresis",
674 "ring",
675 "cedilla",
676 "hungarumlaut",
677 "ogonek",
678 "caron",
679 "emdash",
680 "AE",
681 "ordfeminine",
682 "Lslash",
683 "Oslash",
684 "OE",
685 "ordmasculine",
686 "ae",
687 "dotlessi",
688 "lslash",
689 "oslash",
690 "oe",
691 "germandbls",
692 "onesuperior",
693 "logicalnot",
694 "mu",
695 "trademark",
696 "Eth",
697 "onehalf",
698 "plusminus",
699 "Thorn",
700 "onequarter",
701 "divide",
702 "brokenbar",
703 "degree",
704 "thorn",
705 "threequarters",
706 "twosuperior",
707 "registered",
708 "minus",
709 "eth",
710 "multiply",
711 "threesuperior",
712 "copyright",
713 "Aacute",
714 "Acircumflex",
715 "Adieresis",
716 "Agrave",
717 "Aring",
718 "Atilde",
719 "Ccedilla",
720 "Eacute",
721 "Ecircumflex",
722 "Edieresis",
723 "Egrave",
724 "Iacute",
725 "Icircumflex",
726 "Idieresis",
727 "Igrave",
728 "Ntilde",
729 "Oacute",
730 "Ocircumflex",
731 "Odieresis",
732 "Ograve",
733 "Otilde",
734 "Scaron",
735 "Uacute",
736 "Ucircumflex",
737 "Udieresis",
738 "Ugrave",
739 "Yacute",
740 "Ydieresis",
741 "Zcaron",
742 "aacute",
743 "acircumflex",
744 "adieresis",
745 "agrave",
746 "aring",
747 "atilde",
748 "ccedilla",
749 "eacute",
750 "ecircumflex",
751 "edieresis",
752 "egrave",
753 "iacute",
754 "icircumflex",
755 "idieresis",
756 "igrave",
757 "ntilde",
758 "oacute",
759 "ocircumflex",
760 "odieresis",
761 "ograve",
762 "otilde",
763 "scaron",
764 "uacute",
765 "ucircumflex",
766 "udieresis",
767 "ugrave",
768 "yacute",
769 "ydieresis",
770 "zcaron",
771 "exclamsmall",
772 "Hungarumlautsmall",
773 "dollaroldstyle",
774 "dollarsuperior",
775 "ampersandsmall",
776 "Acutesmall",
777 "parenleftsuperior",
778 "parenrightsuperior",
779 "twodotenleader",
780 "onedotenleader",
781 "zerooldstyle",
782 "oneoldstyle",
783 "twooldstyle",
784 "threeoldstyle",
785 "fouroldstyle",
786 "fiveoldstyle",
787 "sixoldstyle",
788 "sevenoldstyle",
789 "eightoldstyle",
790 "nineoldstyle",
791 "commasuperior",
792 "threequartersemdash",
793 "periodsuperior",
794 "questionsmall",
795 "asuperior",
796 "bsuperior",
797 "centsuperior",
798 "dsuperior",
799 "esuperior",
800 "isuperior",
801 "lsuperior",
802 "msuperior",
803 "nsuperior",
804 "osuperior",
805 "rsuperior",
806 "ssuperior",
807 "tsuperior",
808 "ff",
809 "ffi",
810 "ffl",
811 "parenleftinferior",
812 "parenrightinferior",
813 "Circumflexsmall",
814 "hyphensuperior",
815 "Gravesmall",
816 "Asmall",
817 "Bsmall",
818 "Csmall",
819 "Dsmall",
820 "Esmall",
821 "Fsmall",
822 "Gsmall",
823 "Hsmall",
824 "Ismall",
825 "Jsmall",
826 "Ksmall",
827 "Lsmall",
828 "Msmall",
829 "Nsmall",
830 "Osmall",
831 "Psmall",
832 "Qsmall",
833 "Rsmall",
834 "Ssmall",
835 "Tsmall",
836 "Usmall",
837 "Vsmall",
838 "Wsmall",
839 "Xsmall",
840 "Ysmall",
841 "Zsmall",
842 "colonmonetary",
843 "onefitted",
844 "rupiah",
845 "Tildesmall",
846 "exclamdownsmall",
847 "centoldstyle",
848 "Lslashsmall",
849 "Scaronsmall",
850 "Zcaronsmall",
851 "Dieresissmall",
852 "Brevesmall",
853 "Caronsmall",
854 "Dotaccentsmall",
855 "Macronsmall",
856 "figuredash",
857 "hypheninferior",
858 "Ogoneksmall",
859 "Ringsmall",
860 "Cedillasmall",
861 "questiondownsmall",
862 "oneeighth",
863 "threeeighths",
864 "fiveeighths",
865 "seveneighths",
866 "onethird",
867 "twothirds",
868 "zerosuperior",
869 "foursuperior",
870 "fivesuperior",
871 "sixsuperior",
872 "sevensuperior",
873 "eightsuperior",
874 "ninesuperior",
875 "zeroinferior",
876 "oneinferior",
877 "twoinferior",
878 "threeinferior",
879 "fourinferior",
880 "fiveinferior",
881 "sixinferior",
882 "seveninferior",
883 "eightinferior",
884 "nineinferior",
885 "centinferior",
886 "dollarinferior",
887 "periodinferior",
888 "commainferior",
889 "Agravesmall",
890 "Aacutesmall",
891 "Acircumflexsmall",
892 "Atildesmall",
893 "Adieresissmall",
894 "Aringsmall",
895 "AEsmall",
896 "Ccedillasmall",
897 "Egravesmall",
898 "Eacutesmall",
899 "Ecircumflexsmall",
900 "Edieresissmall",
901 "Igravesmall",
902 "Iacutesmall",
903 "Icircumflexsmall",
904 "Idieresissmall",
905 "Ethsmall",
906 "Ntildesmall",
907 "Ogravesmall",
908 "Oacutesmall",
909 "Ocircumflexsmall",
910 "Otildesmall",
911 "Odieresissmall",
912 "OEsmall",
913 "Oslashsmall",
914 "Ugravesmall",
915 "Uacutesmall",
916 "Ucircumflexsmall",
917 "Udieresissmall",
918 "Yacutesmall",
919 "Thornsmall",
920 "Ydieresissmall",
921 "001.000",
922 "001.001",
923 "001.002",
924 "001.003",
925 "Black",
926 "Bold",
927 "Book",
928 "Light",
929 "Medium",
930 "Regular",
931 "Roman",
932 "Semibold"
933 };
934
935 Gushort fofiType1CISOAdobeCharset[229] = {
936 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
937 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
938 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
939 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
940 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
941 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
942 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
943 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
944 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
945 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
946 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
947 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
948 120, 121, 122, 123, 124, 125, 126, 127, 128, 129,
949 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
950 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
951 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
952 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
953 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
954 180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
955 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
956 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
957 210, 211, 212, 213, 214, 215, 216, 217, 218, 219,
958 220, 221, 222, 223, 224, 225, 226, 227, 228
959 };
960
961 Gushort fofiType1CExpertCharset[166] = {
962 0, 1, 229, 230, 231, 232, 233, 234, 235, 236,
963 237, 238, 13, 14, 15, 99, 239, 240, 241, 242,
964 243, 244, 245, 246, 247, 248, 27, 28, 249, 250,
965 251, 252, 253, 254, 255, 256, 257, 258, 259, 260,
966 261, 262, 263, 264, 265, 266, 109, 110, 267, 268,
967 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
968 279, 280, 281, 282, 283, 284, 285, 286, 287, 288,
969 289, 290, 291, 292, 293, 294, 295, 296, 297, 298,
970 299, 300, 301, 302, 303, 304, 305, 306, 307, 308,
971 309, 310, 311, 312, 313, 314, 315, 316, 317, 318,
972 158, 155, 163, 319, 320, 321, 322, 323, 324, 325,
973 326, 150, 164, 169, 327, 328, 329, 330, 331, 332,
974 333, 334, 335, 336, 337, 338, 339, 340, 341, 342,
975 343, 344, 345, 346, 347, 348, 349, 350, 351, 352,
976 353, 354, 355, 356, 357, 358, 359, 360, 361, 362,
977 363, 364, 365, 366, 367, 368, 369, 370, 371, 372,
978 373, 374, 375, 376, 377, 378
979 };
980
981 Gushort fofiType1CExpertSubsetCharset[87] = {
982 0, 1, 231, 232, 235, 236, 237, 238, 13, 14,
983 15, 99, 239, 240, 241, 242, 243, 244, 245, 246,
984 247, 248, 27, 28, 249, 250, 251, 253, 254, 255,
985 256, 257, 258, 259, 260, 261, 262, 263, 264, 265,
986 266, 109, 110, 267, 268, 269, 270, 272, 300, 301,
987 302, 305, 314, 315, 158, 155, 163, 320, 321, 322,
988 323, 324, 325, 326, 150, 164, 169, 327, 328, 329,
989 330, 331, 332, 333, 334, 335, 336, 337, 338, 339,
990 340, 341, 342, 343, 344, 345, 346
991 };