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

source code of poppler/fofi/FoFiEncodings.cc