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